This commit is contained in:
Nathnael
2026-08-14 07:04:57 +00:00
parent a33494a3ae
commit ab5a4117df
2 changed files with 111 additions and 109 deletions

View File

@@ -173,7 +173,10 @@ export default function CustomerDetailPage() {
enabled: Boolean(id),
}),
);
const contractsQuery = useContractList({ companyId: id, pageSize: 100 }, Boolean(id));
const contractsQuery = useContractList(
{ companyId: id, pageSize: 100 },
Boolean(id),
);
const { pagination: invoicePagination, setPagination: setInvoicePagination } =
usePagination({
@@ -463,18 +466,16 @@ export default function CustomerDetailPage() {
const documentColumns: ColumnDef<CustomerDocument>[] = useMemo(
() => [
{
id: "name",
header: "Document",
cell: ({ row }) => {
const doc = row.original;
return (
id: "code",
header: "Type",
cell: ({ row }) => (
<Stack gap={2}>
<Group gap="sm" wrap="nowrap">
<FileText size={16} className="shrink-0 text-edr-muted" />
<Text size="sm" c="edr-text" truncate>
{doc.name}
{humanize(row.original.code)}
</Text>
{doc.reviewStatus === "change_requested" && (
{row.original.reviewStatus === "change_requested" && (
<Badge size="xs" color="orange" variant="light">
Change requested
</Badge>
@@ -482,22 +483,13 @@ export default function CustomerDetailPage() {
</Group>
{/* The note is the whole point of the request — show it inline so a
second reviewer sees what was already asked for. */}
{doc.reviewStatus === "change_requested" && doc.reviewNote && (
{row.original.reviewStatus === "change_requested" &&
row.original.reviewNote && (
<Text size="xs" c="dimmed" pl={24}>
{doc.reviewNote}
{row.original.reviewNote}
</Text>
)}
</Stack>
);
},
},
{
id: "code",
header: "Type",
cell: ({ row }) => (
<Text size="sm" c="dimmed">
{humanize(row.original.code)}
</Text>
),
},
{
@@ -751,8 +743,7 @@ export default function CustomerDetailPage() {
]}
backTo="/dashboard/customers"
title={company.name}
subtitle={`TIN ${company.tin}${
company.country ? ` · ${company.country}` : ""
subtitle={`TIN ${company.tin}${company.country ? ` · ${company.country}` : ""
}`}
meta={
<Group gap="xs" wrap="nowrap">
@@ -1247,7 +1238,9 @@ export default function CustomerDetailPage() {
status={tableStatus(bookingsQuery)}
emptyMessage="No bookings for this customer."
containerClassName="border-0 shadow-none bg-transparent"
onRowClick={(row) => navigate(`/dashboard/booking-requests/${row.id}`)}
onRowClick={(row) =>
navigate(`/dashboard/booking-requests/${row.id}`)
}
error={
bookingsQuery.isError
? {
@@ -1269,7 +1262,9 @@ export default function CustomerDetailPage() {
status={tableStatus(contractsQuery)}
emptyMessage="No contracts for this customer."
containerClassName="border-0 shadow-none bg-transparent"
onRowClick={(row) => navigate(`/dashboard/contract-requests/${row.id}`)}
onRowClick={(row) =>
navigate(`/dashboard/contract-requests/${row.id}`)
}
error={
contractsQuery.isError
? {

View File

@@ -336,6 +336,7 @@ const App = () => {
createProfile,
reapplyProfile,
isAuthenticated,
isShippingLine,
} = useAuth();
// Attribute replays and exceptions to the signed-in user (id/org only).
@@ -410,6 +411,7 @@ const App = () => {
at their own routes — nothing here is shared with the customer
branch below beyond the shell component itself. Contracts are
absent by design: shipping lines request bookings directly. */}
{isShippingLine && (
<Route element={<RequireShippingLine />}>
<Route
element={
@@ -459,6 +461,10 @@ const App = () => {
path="/shipping-line/settings"
element={<ShippingLineSettingsPage />}
/>
<Route
path="/shipping-line/settings"
element={<ShippingLineSettingsPage />}
/>
<Route
path="/shipping-line/help"
element={<ShippingLineHelpPage />}
@@ -470,6 +476,7 @@ const App = () => {
/>
</Route>
</Route>
)}
{/* Customer app — unchanged. */}
<Route element={<RequireCustomer />}>