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