https://dev.kronoz.win/r/marzneshin.git
1import { Button } from "@marzneshin/common/components";
2
3export const columnsFnBasicEntityTable = ({ onEdit, onDelete, onOpen }: any) => [
4 {
5 header: "ID",
6 accessorKey: "id",
7 },
8 {
9 header: "Name",
10 accessorKey: "name",
11 },
12 {
13 header: "Created At",
14 accessorKey: "createdAt",
15 },
16 {
17 header: "Actions",
18 cell: ({ row }: any) => (
19 <div className="flex items-center gap-2 flex-row">
20 <Button size="sm" onClick={() => onEdit(row.original)}>Edit</Button>
21 <Button size="sm" variant="secondary" onClick={() => onOpen(row.original)}>Open</Button>
22 <Button size="sm" variant="destructive" onClick={() => onDelete(row.original)}>Delete</Button>
23 </div>
24 ),
25 },
26];