mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-07 15:08:54 +00:00
* feat(settings): add settings and approvals POC shells (AP-7) Add app shell nav plus mock settings CRUD routes and an approvals inbox so the POC demo path works without an API. * fix(build): generate router types before tsc CI failed because src/router.ts is gitignored and tsc ran before Vite created it.
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { Container } from "@mui/material";
|
|
import type { GridColDef } from "@mui/x-data-grid";
|
|
import { useVendors } from "@/domain/vendors/use-vendors";
|
|
import type { MockVendor } from "@/mocks";
|
|
import { useNavigate } from "@/router";
|
|
import { SettingsListPage } from "@/settings/SettingsListPage";
|
|
|
|
const columns: GridColDef<MockVendor>[] = [
|
|
{ field: "name", headerName: "Name", flex: 1.4, minWidth: 160 },
|
|
{ field: "email", headerName: "Email", flex: 1.4, minWidth: 180 },
|
|
{ field: "defaultPaymentMethod", headerName: "Payment method", flex: 1, minWidth: 130 },
|
|
];
|
|
|
|
export default function VendorsListPage() {
|
|
const navigate = useNavigate();
|
|
const { data = [], isLoading, isError, error } = useVendors();
|
|
|
|
return (
|
|
<Container maxWidth="xl" sx={{ py: 4 }}>
|
|
<SettingsListPage
|
|
title="Vendors"
|
|
description="Mock vendor master data."
|
|
testId="settings-vendors-grid"
|
|
rows={data}
|
|
columns={columns}
|
|
isLoading={isLoading}
|
|
isError={isError}
|
|
error={error instanceof Error ? error : null}
|
|
onNew={() => navigate("/settings/vendors/new")}
|
|
onRowClick={(row) => navigate("/settings/vendors/:id", { params: { id: row.id } })}
|
|
/>
|
|
</Container>
|
|
);
|
|
}
|