This commit is contained in:
2026-04-09 15:17:07 +03:00
parent c5f6d2f596
commit 29cc9c6f4e
23 changed files with 420 additions and 190 deletions
+12 -5
View File
@@ -37,11 +37,18 @@ import { <RESOURCE>_ROUTES } from "@garage/api"
// ── Constants ──
// Static select options (if needed):
// const STATUS_OPTIONS = [
// { value: "active", label: "Active" },
// { value: "inactive", label: "Inactive" },
// ]
// ALWAYS derive select options from API enums imported from "@garage/api".
// NEVER hardcode enum values inline — they must stay in sync with the backend.
//
// Pattern: import the enum array, then .map() to produce { value, label } pairs.
//
// const STATUS_OPTIONS = SomeStatus.map((v) => ({
// value: v,
// label: v.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()),
// }))
//
// If no matching enum exists in packages/api/src/contracts/enums.ts, add it there first,
// then import and use it here.
// ── Props ──