import ConsignmentTable from "../../components/consignments/ConsignmentTable";
import { useConsignments } from "../../hooks/useConsignments";

const ConsignmentsPage = () => {
  const { data, isLoading } = useConsignments();
  const items = data?.items ?? [];

  return (
    <div className="flex flex-col gap-4">
      <h1 className="text-2xl font-semibold text-gray-900">Consignments</h1>
      {isLoading ? (
        <div className="text-sm text-gray-500">Loading…</div>
      ) : (
        <ConsignmentTable consignments={items} />
      )}
    </div>
  );
};

export default ConsignmentsPage;
