v2-table
This commit is contained in:
1 parent
6395e8a10e
commit
6ffa5ac648
4 files changed
+142
-7
No files matched your search
@@ -1,25 +1,42 @@
|
||||
import { BasePageWithStates } from "@/Components/v2/design-elements";
|
||||
import { NotificationsTable } from "@/Pages/Notifications/components/NotificationsTable";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useGet } from "@/Hooks/UseApi";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { Notification } from "@/Types/Notification";
|
||||
|
||||
const NotificationsPage = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [selectedChannel, setSelectedChannel] = useState<Notification | null>(null);
|
||||
|
||||
const {
|
||||
data: notifications,
|
||||
isLoading,
|
||||
isValidating,
|
||||
error,
|
||||
refetch,
|
||||
} = useGet<Notification[]>("/notifications/team");
|
||||
|
||||
return (
|
||||
<BasePageWithStates
|
||||
page={t("pages.notifications.fallback.title")}
|
||||
bullets={
|
||||
t("pages.notifications.fallback.checks", {
|
||||
returnObjects: true,
|
||||
}) as string[]
|
||||
t("pages.notifications.fallback.checks", { returnObjects: true }) as string[]
|
||||
}
|
||||
loading={false}
|
||||
error={false}
|
||||
items={[]}
|
||||
loading={isLoading || isValidating}
|
||||
error={!!error}
|
||||
items={notifications ?? []}
|
||||
actionButtonText={t("pages.notifications.fallback.actionButton")}
|
||||
actionLink="/notifications/create"
|
||||
>
|
||||
Notifications
|
||||
<NotificationsTable
|
||||
notifications={notifications ?? []}
|
||||
setSelectedChannel={setSelectedChannel}
|
||||
/>
|
||||
</BasePageWithStates>
|
||||
);
|
||||
};
|
||||
|
||||
export default NotificationsPage;
|
||||
Reference in new issue
Block a user