import { NavLink, Outlet, useLocation, useParams } from "react-router"; import { useVendorPortal } from "@/app/v/_components/vendor-portal-context"; import { VendorPortalProvider } from "@/app/v/_components/vendor-portal-provider"; import { Text } from "@/components/ui/text"; import "@/app/v/_components/vendor-portal.css"; function VendorPortalHeader() { const { vendor, status } = useVendorPortal(); return (
Sea Haven Industries — Vendor Portal
{status === "ready" && vendor != null && Boolean(vendor.companyName) && (
{vendor.companyName}
)}
); } function VendorPortalNav() { const { token } = useParams(); const { pathname } = useLocation(); const onDetail = /\/dispatch\//.test(pathname); return ( ); } function VendorPortalBody() { const { status, error } = useVendorPortal(); if (status === "loading") { return (
Loading…
); } if (status === "error") { return (
Access Denied {error?.message || "This link is invalid or has expired. Please contact your dispatcher for a new link."}
); } return ( <>
); } export default function VendorPortalLayout() { return (
); }