import { ColumnDef } from '@tanstack/react-table'; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; import { Button } from '@/components/ui/button'; import { Link, useForm } from '@inertiajs/react'; import { LoaderCircleIcon, MoreVerticalIcon, PlayIcon } from 'lucide-react'; import FormSuccessful from '@/components/form-successful'; import { useState } from 'react'; import { Command } from '@/types/command'; import EditCommand from '@/pages/commands/components/edit-command'; import CopyableBadge from '@/components/copyable-badge'; import Execute from '@/pages/commands/components/execute'; function Delete({ command }: { command: Command }) { const [open, setOpen] = useState(false); const form = useForm(); const submit = () => { form.delete(route('commands.destroy', { server: command.server_id, site: command.site_id, command: command.id }), { onSuccess: () => { setOpen(false); }, }); }; return ( e.preventDefault()}> Delete Delete command Delete command

Are you sure you want to this command?

); } export const columns: ColumnDef[] = [ { accessorKey: 'name', header: 'Name', enableColumnFilter: true, enableSorting: true, }, { accessorKey: 'command', header: 'Command', enableColumnFilter: true, enableSorting: true, cell: ({ row }) => { return ; }, }, { id: 'actions', enableColumnFilter: false, enableSorting: false, cell: ({ row }) => { return (
e.preventDefault()}>Edit e.preventDefault()}>Executions
); }, }, ];