https://dev.kronoz.win/r/marzneshin.git
1
2import { FC } from 'react'
3import { NodeType, NodesStatus, NodesStatusBadge } from '../..'
4import { Table, TableBody, TableCell, TableHead, TableRow } from '@marzneshin/common/components'
5import { useTranslation } from 'react-i18next'
6
7
8interface NodesDetailTableProps {
9 node: NodeType
10}
11
12
13export const NodesDetailTable: FC<NodesDetailTableProps> = ({ node }) => {
14 const { t } = useTranslation()
15 return (
16 <Table>
17 <TableBody>
18 <TableRow >
19 <TableHead >
20 {t('name')}
21 </TableHead>
22 <TableCell >
23 {node.name}
24 </TableCell>
25 </TableRow>
26 <TableRow>
27 <TableHead >
28 {t('address')}
29 </TableHead>
30 <TableCell >
31 {node.address}:{node.port}
32 </TableCell>
33 </TableRow>
34 <TableRow>
35 <TableHead className="p-5">
36 {t('page.nodes.usage_coefficient')}
37 </TableHead>
38 <TableCell >
39 {node.usage_coefficient}
40 </TableCell>
41 </TableRow>
42 <TableRow>
43 <TableHead>
44 {t('status')}
45 </TableHead>
46 <TableCell>
47 <NodesStatusBadge status={NodesStatus[node.status]} />
48 </TableCell>
49 </TableRow>
50 </TableBody>
51 </Table>
52 )
53}