2026-02-02 19:20:59 +00:00
|
|
|
import { BasePageWithStates } from "@/Components/v2/design-elements";
|
|
|
|
|
import { StatusPagesTable } from "./Components/StatusPagesTable";
|
|
|
|
|
import { useGet } from "@/Hooks/UseApi";
|
|
|
|
|
import type { StatusPage } from "@/Types/StatusPage";
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
2026-02-02 22:15:57 +00:00
|
|
|
import { HeaderCreate } from "@/Components/v2/common";
|
|
|
|
|
import { useIsAdmin } from "@/Hooks/useIsAdmin";
|
2026-02-02 19:20:59 +00:00
|
|
|
|
|
|
|
|
const StatusPages = () => {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
data: statusPages,
|
|
|
|
|
isLoading,
|
|
|
|
|
error,
|
|
|
|
|
} = useGet<StatusPage[]>("/status-page/team");
|
|
|
|
|
|
2026-02-02 22:15:57 +00:00
|
|
|
const isAdmin = useIsAdmin();
|
|
|
|
|
|
2026-02-02 19:20:59 +00:00
|
|
|
return (
|
|
|
|
|
<BasePageWithStates
|
|
|
|
|
page={t("pages.statusPages.title")}
|
|
|
|
|
loading={isLoading}
|
|
|
|
|
bullets={
|
|
|
|
|
t("pages.statusPages.fallback.checks", { returnObjects: true }) as string[]
|
|
|
|
|
}
|
|
|
|
|
error={!!error}
|
|
|
|
|
items={statusPages ?? []}
|
|
|
|
|
actionButtonText={t("pages.statusPages.fallback.actionButton")}
|
|
|
|
|
actionLink="/status/uptime/create"
|
|
|
|
|
>
|
2026-02-02 22:15:57 +00:00
|
|
|
<HeaderCreate
|
|
|
|
|
path="/status/uptime/create"
|
|
|
|
|
isAdmin={isAdmin}
|
|
|
|
|
/>
|
2026-02-02 19:20:59 +00:00
|
|
|
<StatusPagesTable data={statusPages ?? []} />
|
|
|
|
|
</BasePageWithStates>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default StatusPages;
|