"use client";

import React from "react";
import ItemDiscrepanciesPage from "@/components/discrepancies/ItemDiscrepanciesPage";
import { useAuth } from "@/contexts/AuthContext";

export default function ItemDiscrepanciesRoutePage() {
  const { isAdmin } = useAuth();

  const shipmentLinkPath = isAdmin()
    ? (id: number) => `/warehouses/shipments/${id}`
    : (id: number) => `/manufacturer/shipments/${id}`;
  const purchaseOrderLinkPath = isAdmin()
    ? (id: number) => `/purchase-orders/${id}`
    : (id: number) => `/manufacturer/manage-orders/${id}`;

  return (
    <ItemDiscrepanciesPage
      shipmentLinkPath={shipmentLinkPath}
      purchaseOrderLinkPath={purchaseOrderLinkPath}
      palletDiscrepanciesPath="/discrepancies/pallets"
    />
  );
}
