import { BasePageWithStates } from "@/Components/design-elements"; import { NotificationsTable } from "@/Pages/Notifications/components/NotificationsTable"; import { Dialog } from "@/Components/inputs"; import { HeaderCreate } from "@/Components/common"; import { useState } from "react"; import { useGet, useDelete } from "@/Hooks/UseApi"; import { useTranslation } from "react-i18next"; import type { Notification } from "@/Types/Notification"; import { useIsAdmin } from "@/Hooks/useIsAdmin"; const NotificationsPage = () => { const { t } = useTranslation(); const isAdmin = useIsAdmin(); const [selectedChannel, setSelectedChannel] = useState(null); const isDialogOpen = Boolean(selectedChannel); const { data: notifications, isLoading, isValidating, error, refetch, } = useGet("/notifications/team", {}, { keepPreviousData: true }); const { deleteFn, loading: isDeleting } = useDelete(); const handleConfirm = async () => { if (!selectedChannel) return; await deleteFn(`/notifications/${selectedChannel.id}`); setSelectedChannel(null); refetch(); }; const handleCancel = () => { setSelectedChannel(null); }; return ( ); }; export default NotificationsPage;