doctor and pharmacies crud
This commit is contained in:
@@ -15,11 +15,14 @@ import type { Dispatch, SetStateAction } from "react";
|
||||
|
||||
interface Props {
|
||||
setDetail: Dispatch<SetStateAction<DoctorListResData | null>>;
|
||||
setEditingPlan: Dispatch<SetStateAction<DoctorListResData | null>>;
|
||||
setDialogOpen: Dispatch<SetStateAction<boolean>>;
|
||||
setDetailDialog: Dispatch<SetStateAction<boolean>>;
|
||||
doctor: DoctorListResData[] | [];
|
||||
isLoading: boolean;
|
||||
isError: boolean;
|
||||
isFetching: boolean;
|
||||
handleDelete: (user: DoctorListResData) => void;
|
||||
}
|
||||
|
||||
const TableDoctor = ({
|
||||
@@ -27,7 +30,10 @@ const TableDoctor = ({
|
||||
setDetail,
|
||||
setDetailDialog,
|
||||
isError,
|
||||
setEditingPlan,
|
||||
isLoading,
|
||||
setDialogOpen,
|
||||
handleDelete,
|
||||
isFetching,
|
||||
}: Props) => {
|
||||
return (
|
||||
@@ -100,8 +106,8 @@ const TableDoctor = ({
|
||||
size="icon"
|
||||
className="bg-blue-600 text-white cursor-pointer hover:bg-blue-600 hover:text-white"
|
||||
onClick={() => {
|
||||
// setEditingPlan(item);
|
||||
// setDialogOpen(true);
|
||||
setEditingPlan(item);
|
||||
setDialogOpen(true);
|
||||
}}
|
||||
>
|
||||
<Pencil size={18} />
|
||||
@@ -110,7 +116,7 @@ const TableDoctor = ({
|
||||
variant="destructive"
|
||||
size="icon"
|
||||
className="cursor-pointer"
|
||||
// onClick={() => handleDelete(item.id)}
|
||||
onClick={() => handleDelete(item)}
|
||||
>
|
||||
<Trash2 size={18} />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user