Files
digifi-bko/src/app/modules/process/user-approved/table/columns/UserSelectionCell.tsx
T
victorAnumudu 3a35a34266 initial commit
2024-05-15 20:22:33 +01:00

27 lines
735 B
TypeScript

import { FC, useMemo } from "react";
import { ID } from "../../../../../../_digifi/helpers";
import { useListView } from "../../core/ListViewProvider";
type Props = {
id: ID;
};
const UserSelectionCell: FC<Props> = ({ id }) => {
const { selected, onSelect } = useListView();
const isSelected = useMemo(() => selected.includes(id), [id, selected]);
return (
<div className="form-check form-check-custom form-check-solid">
<input
className="form-check-input"
type="checkbox"
data-kt-check={isSelected}
data-kt-check-target="#kt_table_users .form-check-input"
checked={isSelected}
onChange={() => onSelect(id)}
/>
</div>
);
};
export { UserSelectionCell };