gitscope
← marzneshin / nightly / 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 { AlertCard, Page, Loading } from '@marzneshin/common/components'
 2import { NodesTable } from '@marzneshin/modules/nodes'
 3import { Link, createLazyFileRoute, Outlet } from '@tanstack/react-router'
 4import { type FC, Suspense } from 'react'
 5import { useTranslation } from 'react-i18next'
 6import { SudoRoute } from '@marzneshin/libs/sudo-routes'
 7
 8export const NodesPage: FC = () => {
 9  const { t } = useTranslation()
10  return (
11    <Page
12      title={t('nodes')}
13      className="sm:w-screen md:w-full"
14      footer={
15        <AlertCard
16          title={t('page.nodes.certificate-alert.title')}
17          desc={
18            <>
19              {t('page.nodes.certificate-alert.desc')}
20              <Link
21                className="m-1 font-semibold text-secondary-foreground"
22                to="/settings"
23              >
24                {t('page.nodes.certificate-alert.click')}
25              </Link>
26            </>
27          }
28        />
29      }
30    >
31      <NodesTable />
32      <Suspense fallback={<Loading />}>
33        <Outlet />
34      </Suspense>
35    </Page>
36  )
37}
38
39export const Route = createLazyFileRoute('/_dashboard/nodes')({
40  component: () => (
41    <SudoRoute>
42      {' '}
43      <NodesPage />{' '}
44    </SudoRoute>
45  ),
46})