gitscope
← marzneshin / v0.6.0 / dashboard/src/routes/_dashboard/nodes.lazy.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/routes/_dashboard/nodes.lazy.tsx · TypeScript
Blame Raw
 1import {
 2    AlertCard,
 3    Page,
 4    Loading,
 5} from '@marzneshin/components';
 6import { NodesTable } from '@marzneshin/modules/nodes';
 7import { Link, createFileRoute, Outlet } from '@tanstack/react-router'
 8import { type FC, Suspense } from 'react';
 9import { useTranslation } from 'react-i18next';
10import { SudoRoute } from "@marzneshin/features/sudo-routes";
11
12export const NodesPage: FC = () => {
13    const { t } = useTranslation();
14    return (
15        <Page
16            title={t('nodes')}
17            className="sm:w-screen md:w-full"
18            footer={
19                <AlertCard
20                    title={t('page.nodes.certificate-alert.title')}
21                    desc={
22                        <>
23                            {t('page.nodes.certificate-alert.desc')}
24                            <Link className="m-1 font-semibold text-secondary-foreground" to="/settings">{t('page.nodes.certificate-alert.click')}</Link>
25                        </>
26                    }
27                />
28            }
29        >
30            <NodesTable />
31            <Suspense fallback={<Loading />}>
32                <Outlet />
33            </Suspense>
34        </Page >
35    )
36};
37
38export const Route = createFileRoute('/_dashboard/nodes')({
39    component: () => <SudoRoute> <NodesPage /> </SudoRoute>
40})