|
1 | 1 | import { DataTableColumnHeader } from '@/components/data-table-column-header'; |
| 2 | +import DropdownMenuCopyButton from '@/components/ui-helpers/dropdown-menu-copy-button'; |
2 | 3 | import { Badge } from '@/components/ui/badge'; |
| 4 | +import { Button } from '@/components/ui/button'; |
| 5 | +import { |
| 6 | + DropdownMenu, |
| 7 | + DropdownMenuContent, |
| 8 | + DropdownMenuItem, |
| 9 | + DropdownMenuLabel, |
| 10 | + DropdownMenuSeparator, |
| 11 | + DropdownMenuTrigger, |
| 12 | +} from '@/components/ui/dropdown-menu'; |
3 | 13 | import { normalizeString } from '@/lib/utils'; |
| 14 | +import employee_info from '@/routes/employee_info'; |
4 | 15 | import { TableEmployeeInfo } from '@/types/application/employee'; |
| 16 | +import { Link } from '@inertiajs/react'; |
5 | 17 | import { ColumnDef } from '@tanstack/react-table'; |
6 | 18 | import { format } from 'date-fns'; |
| 19 | +import { MoreHorizontal } from 'lucide-react'; |
7 | 20 |
|
8 | 21 | export const column: ColumnDef<TableEmployeeInfo>[] = [ |
9 | 22 | { |
@@ -51,4 +64,31 @@ export const column: ColumnDef<TableEmployeeInfo>[] = [ |
51 | 64 | cell: ({ row }) => format(row.original.updated_at, 'PPpp'), |
52 | 65 | enableSorting: true, |
53 | 66 | }, |
| 67 | + |
| 68 | + { |
| 69 | + id: 'actions', |
| 70 | + cell: ({ row }) => ( |
| 71 | + <DropdownMenu> |
| 72 | + <DropdownMenuTrigger asChild> |
| 73 | + <Button variant="ghost" className="h-8 w-8 p-0"> |
| 74 | + <span className="sr-only">Open menu</span> |
| 75 | + <MoreHorizontal className="h-4 w-4" /> |
| 76 | + </Button> |
| 77 | + </DropdownMenuTrigger> |
| 78 | + <DropdownMenuContent align="end"> |
| 79 | + <DropdownMenuLabel>Actions</DropdownMenuLabel> |
| 80 | + <DropdownMenuItem asChild> |
| 81 | + <DropdownMenuCopyButton content={row.original.full_name}>Copy Name</DropdownMenuCopyButton> |
| 82 | + </DropdownMenuItem> |
| 83 | + |
| 84 | + <DropdownMenuSeparator /> |
| 85 | + <DropdownMenuItem asChild> |
| 86 | + <Link href={employee_info.show(row.original.id)} prefetch> |
| 87 | + Show |
| 88 | + </Link> |
| 89 | + </DropdownMenuItem> |
| 90 | + </DropdownMenuContent> |
| 91 | + </DropdownMenu> |
| 92 | + ), |
| 93 | + }, |
54 | 94 | ]; |
0 commit comments