import { Head, Link, router } from '@inertiajs/react';
import { Plus } from 'lucide-react';
import { useState } from 'react';
import { CardTable } from '@/components/data-display';
import { DeleteConfirmDialog } from '@/components/dialogs';
import { useCardTableExpand } from '@/components/hooks/use-card-table-expand';
import { PageHeader } from '@/components/layout';
import { Button } from '@/components/ui/button';
import { useCan } from '@/hooks/use-can';
import { useServerTable } from '@/hooks/use-server-table';
import {
destroy,
create as restockCreate,
index as restockIndex,
edit as restockEdit,
} from '@/routes/admin/manage/restocks';
import type { Restock } from './columns';
import { RestockCardRow } from './restock-card';
import { RestockItemSubRow } from './restock-sub-row';
type Props = {
restocks: {
data: Restock[];
current_page: number;
last_page: number;
per_page: number;
total: number;
};
};
export default function RestockIndex({ restocks }: Props) {
const { can } = useCan();
const [deleting, setDeleting] = useState