"use client"; import { DrawingCard } from "@/components/drawings/card"; import { useDrawings } from "@/hooks/use-drawing"; import { Loader2 } from "lucide-react"; interface DrawingListProps { type: "CONTRACT" | "SHOP"; } export function DrawingList({ type }: DrawingListProps) { const { data: drawings, isLoading, isError } = useDrawings(type, { type }); // Note: The hook handles switching services based on type. // The params { type } might be redundant if getAll doesn't use it, but safe to pass. if (isLoading) { return (
); } if (isError) { return (
Failed to load drawings.
); } if (!drawings || drawings.length === 0) { return (
No drawings found.
); } return (
{drawings.map((drawing: any) => ( ))}
); }