2026-01-29 17:52:10 +00:00
|
|
|
import { BasePageWithStates } from "@/Components/v2/design-elements";
|
2026-01-29 18:14:23 +00:00
|
|
|
import { NotificationsTable } from "@/Pages/Notifications/components/NotificationsTable";
|
2026-01-29 17:52:10 +00:00
|
|
|
|
2026-01-29 18:14:23 +00:00
|
|
|
import { useState } from "react";
|
|
|
|
|
import { useGet } from "@/Hooks/UseApi";
|
2026-01-29 17:52:10 +00:00
|
|
|
import { useTranslation } from "react-i18next";
|
2026-01-29 18:14:23 +00:00
|
|
|
import type { Notification } from "@/Types/Notification";
|
|
|
|
|
|
2026-01-29 17:52:10 +00:00
|
|
|
const NotificationsPage = () => {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
2026-01-29 18:14:23 +00:00
|
|
|
const [selectedChannel, setSelectedChannel] = useState<Notification | null>(null);
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
data: notifications,
|
|
|
|
|
isLoading,
|
|
|
|
|
isValidating,
|
|
|
|
|
error,
|
|
|
|
|
refetch,
|
|
|
|
|
} = useGet<Notification[]>("/notifications/team");
|
|
|
|
|
|
2026-01-29 17:52:10 +00:00
|
|
|
return (
|
|
|
|
|
<BasePageWithStates
|
|
|
|
|
page={t("pages.notifications.fallback.title")}
|
|
|
|
|
bullets={
|
2026-01-29 18:14:23 +00:00
|
|
|
t("pages.notifications.fallback.checks", { returnObjects: true }) as string[]
|
2026-01-29 17:52:10 +00:00
|
|
|
}
|
2026-01-29 18:14:23 +00:00
|
|
|
loading={isLoading || isValidating}
|
|
|
|
|
error={!!error}
|
|
|
|
|
items={notifications ?? []}
|
2026-01-29 17:52:10 +00:00
|
|
|
actionButtonText={t("pages.notifications.fallback.actionButton")}
|
|
|
|
|
actionLink="/notifications/create"
|
|
|
|
|
>
|
2026-01-29 18:14:23 +00:00
|
|
|
<NotificationsTable
|
|
|
|
|
notifications={notifications ?? []}
|
|
|
|
|
setSelectedChannel={setSelectedChannel}
|
|
|
|
|
/>
|
2026-01-29 17:52:10 +00:00
|
|
|
</BasePageWithStates>
|
|
|
|
|
);
|
|
|
|
|
};
|
2026-01-29 18:14:23 +00:00
|
|
|
|
2026-01-29 17:52:10 +00:00
|
|
|
export default NotificationsPage;
|