gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/hosts/tables/inbound-hosts/columns.tsx · v0.5.3
Source
1 3b7feef Mrdn 2y ago import { ColumnDef } from "@tanstack/react-table"
2 3b7feef Mrdn 2y ago import { HostType } from "@marzneshin/features/hosts"
3 3b7feef Mrdn 2y ago import { DataTableColumnHeader } from "@marzneshin/components/data-table/column-header"
4 3b7feef Mrdn 2y ago import i18n from "@marzneshin/features/i18n"
5 4708fcb Dawsh 2y ago import {
6 4708fcb Dawsh 2y ago type ColumnActions
7 4708fcb Dawsh 2y ago } from "@marzneshin/features/entity-table";
8 4708fcb Dawsh 2y ago import {
9 4708fcb Dawsh 2y ago DataTableActionsCell,
10 4708fcb Dawsh 2y ago NoPropogationButton,
11 4708fcb Dawsh 2y ago } from "@marzneshin/components"
12 3b7feef Mrdn 2y ago
13 4708fcb Dawsh 2y ago export const columns = (actions: ColumnActions<HostType>): ColumnDef<HostType>[] => ([
14 3b7feef Mrdn 2y ago {
15 3b7feef Mrdn 2y ago accessorKey: "remark",
16 3b7feef Mrdn 2y ago header: ({ column }) => <DataTableColumnHeader title={i18n.t('name')} column={column} />,
17 3b7feef Mrdn 2y ago },
18 3b7feef Mrdn 2y ago {
19 3b7feef Mrdn 2y ago accessorKey: "address",
20 3b7feef Mrdn 2y ago header: ({ column }) => <DataTableColumnHeader title={i18n.t('address')} column={column} />,
21 3b7feef Mrdn 2y ago },
22 3b7feef Mrdn 2y ago {
23 3b7feef Mrdn 2y ago accessorKey: "port",
24 ec7410a Mardin 2y ago header: ({ column }) => <DataTableColumnHeader title={i18n.t('port')} column={column} />,
25 3b7feef Mrdn 2y ago },
26 3b7feef Mrdn 2y ago {
27 3b7feef Mrdn 2y ago id: "actions",
28 4708fcb Dawsh 2y ago cell: ({ row }) => {
29 4708fcb Dawsh 2y ago return (
30 4708fcb Dawsh 2y ago <NoPropogationButton row={row} actions={actions}>
31 4708fcb Dawsh 2y ago <DataTableActionsCell {...actions} row={row} />
32 4708fcb Dawsh 2y ago </NoPropogationButton>
33 4708fcb Dawsh 2y ago );
34 4708fcb Dawsh 2y ago },
35 4708fcb Dawsh 2y ago }
36 3b7feef Mrdn 2y ago ]);