import { useState } from "react"; import { BasePageWithStates } from "@/Components/v2/design-elements"; import { Dialog } from "@/Components/v2/inputs"; import { StatusPagesTable } from "./Components/StatusPagesTable"; import { useGet, useDelete } from "@/Hooks/UseApi"; import type { StatusPage } from "@/Types/StatusPage"; import { useTranslation } from "react-i18next"; import { HeaderCreate } from "@/Components/v2/common"; import { useIsAdmin } from "@/Hooks/useIsAdmin"; const StatusPages = () => { const { t } = useTranslation(); const { data: statusPages, isLoading, error, refetch, } = useGet("/status-page/team"); const { deleteFn, loading: isDeleting } = useDelete(); const [selectedStatusPage, setSelectedStatusPage] = useState(null); const isDialogOpen = Boolean(selectedStatusPage); const isAdmin = useIsAdmin(); const handleConfirm = async () => { if (!selectedStatusPage) return; await deleteFn(`/status-page/${selectedStatusPage.id}`); setSelectedStatusPage(null); refetch(); }; const handleCancel = () => { setSelectedStatusPage(null); }; return ( ); }; export default StatusPages;