"use client"; import { useState } from "react"; import RouteTraceDashboard from "./RouteTraceDashboard"; import AdminLookupPage from "./AdminLookupPage"; import LotListTable from "./LotListTable"; import Link from "next/link"; import { RouteTraceStats, HaulingLot, FieldYieldSummary, InventoryByCrop, RecentLotEvent, } from "@/actions/route-trace/lots"; type Tab = "dashboard" | "lots" | "lookup" | "settings"; const TABS: { id: Tab; label: string }[] = [ { id: "dashboard", label: "Dashboard" }, { id: "lots", label: "Lots" }, { id: "lookup", label: "Lookup" }, { id: "settings", label: "Settings" }, ]; type Props = { stats: RouteTraceStats; recentLots: HaulingLot[]; haulingLots: HaulingLot[]; fieldYield: FieldYieldSummary[]; inventoryByCrop: InventoryByCrop[]; recentActivity: RecentLotEvent[]; brandId: string; lots: HaulingLot[]; }; export default function RouteTracePage({ stats, recentLots, haulingLots, fieldYield, inventoryByCrop, recentActivity, brandId, lots, }: Props) { const [activeTab, setActiveTab] = useState("dashboard"); return (
{/* Header */}

Route Trace

Track lots from field to delivery

{activeTab === "lots" && ( New Lot )}
{/* Tab nav */}
{/* Tab content */} {activeTab === "dashboard" && ( )} {activeTab === "lots" && (

{lots.length} lot{lots.length !== 1 ? "s" : ""} total

)} {activeTab === "lookup" && (
)} {activeTab === "settings" && (

Route Trace Settings

Configure your traceability workflow and defaults

Manage Add-ons →
)}
); }