import { Result } from "antd"; import { useDeleteMaterial, useMaterialList } from "../../../shared/hooks/use-materials"; import { MaterialList } from "./MaterialList"; interface MaterialSidebarProps { onAddClick: () => void; onDelete: (id: string) => void; onSelect: (id: string) => void; projectId: string; selectedId: null | string; } export function MaterialSidebar({ onAddClick, onDelete, onSelect, projectId, selectedId }: MaterialSidebarProps) { const { data, error, isLoading, refetch } = useMaterialList(projectId, { pageSize: 200 }); const deleteMutation = useDeleteMaterial(projectId); const handleDelete = (id: string) => { void deleteMutation.mutate({ materialId: id, projectId }, { onSuccess: () => onDelete(id) }); }; if (error) { return (