https://dev.kronoz.win/r/marzneshin.git
| 1 |
4708fcb |
Dawsh |
2y ago |
import { |
| 2 |
4708fcb |
Dawsh |
2y ago |
createFileRoute, |
| 3 |
4708fcb |
Dawsh |
2y ago |
useNavigate, |
| 4 |
4708fcb |
Dawsh |
2y ago |
} from "@tanstack/react-router"; |
| 5 |
4708fcb |
Dawsh |
2y ago |
import { |
| 6 |
4708fcb |
Dawsh |
2y ago |
AdminsDeleteConfirmationDialog, |
| 7 |
4708fcb |
Dawsh |
2y ago |
useRouterAdminContext, |
| 8 |
4708fcb |
Dawsh |
2y ago |
} from "@marzneshin/features/admins"; |
| 9 |
4708fcb |
Dawsh |
2y ago |
import { useDialog } from "@marzneshin/hooks"; |
| 10 |
4708fcb |
Dawsh |
2y ago |
|
| 11 |
4708fcb |
Dawsh |
2y ago |
const AdminDelete = () => { |
| 12 |
4708fcb |
Dawsh |
2y ago |
const [deleteDialogOpen, setDeleteDialogOpen] = useDialog(true); |
| 13 |
4708fcb |
Dawsh |
2y ago |
const value = useRouterAdminContext() |
| 14 |
4708fcb |
Dawsh |
2y ago |
const navigate = useNavigate({ from: "/admins/$adminId/delete" }); |
| 15 |
4708fcb |
Dawsh |
2y ago |
|
| 16 |
4708fcb |
Dawsh |
2y ago |
return !!(value?.admin) && ( |
| 17 |
4708fcb |
Dawsh |
2y ago |
<AdminsDeleteConfirmationDialog |
| 18 |
4708fcb |
Dawsh |
2y ago |
open={deleteDialogOpen} |
| 19 |
4708fcb |
Dawsh |
2y ago |
onOpenChange={setDeleteDialogOpen} |
| 20 |
4708fcb |
Dawsh |
2y ago |
entity={value.admin} |
| 21 |
4708fcb |
Dawsh |
2y ago |
onClose={() => navigate({ to: "/admins" })} |
| 22 |
4708fcb |
Dawsh |
2y ago |
/> |
| 23 |
4708fcb |
Dawsh |
2y ago |
); |
| 24 |
4708fcb |
Dawsh |
2y ago |
} |
| 25 |
4708fcb |
Dawsh |
2y ago |
|
| 26 |
4708fcb |
Dawsh |
2y ago |
export const Route = createFileRoute('/_dashboard/admins/$adminId/delete')({ |
| 27 |
4708fcb |
Dawsh |
2y ago |
component: AdminDelete, |
| 28 |
4708fcb |
Dawsh |
2y ago |
}) |