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