import { Head, Link } from '@inertiajs/react'; import type { Order } from '@/types/order'; import { Card, CardContent } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Trash2, ShoppingBag } from 'lucide-react'; import { DataTable } from '@/components/data-table'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogTitle, } from "@/components/ui/alert-dialog" import * as orderRoutes from '@/routes/order'; import { useOrderIndex } from './hooks/use-order-index'; import { getColumns } from './partials/columns'; export default function OrderIndex({ orders }: { orders: Order[] }) { const { isDeleteDialogOpen, isBulkDeleteDialogOpen, orderToDelete, rowsToDelete, rowSelection, setRowSelection, setRowsToDelete, setIsDeleteDialogOpen, setIsBulkDeleteDialogOpen, onDelete, confirmDelete, confirmBulkDelete, } = useOrderIndex(); const columns = getColumns({ onDelete }); return (