diff --git a/client/src/pages/filaments/show.tsx b/client/src/pages/filaments/show.tsx index dd6e719..0175057 100644 --- a/client/src/pages/filaments/show.tsx +++ b/client/src/pages/filaments/show.tsx @@ -21,13 +21,21 @@ export const FilamentShow: React.FC = () => { const record = data?.data; + const formatTitle = (item: IFilament) => { + let vendorPrefix = ""; + if (item.vendor) { + vendorPrefix = `${item.vendor.name} - `; + } + return `[Filament #${item.id}] ${vendorPrefix}${item.name}`; + }; + const formatVendor = (item: IVendor) => { const URL = `/vendor/show/${item.id}`; return {item.name}; }; return ( - + {t("filament.fields.id")} {t("filament.fields.vendor")} diff --git a/client/src/pages/spools/show.tsx b/client/src/pages/spools/show.tsx index 39fea7a..0846e78 100644 --- a/client/src/pages/spools/show.tsx +++ b/client/src/pages/spools/show.tsx @@ -34,17 +34,24 @@ export const SpoolShow: React.FC = () => { if (item.material) { material = ` - ${item.material}`; } - const label = `${vendorPrefix}${name}${material}`; + return `${vendorPrefix}${name}${material}`; + }; + + const filamentURL = (item: IFilament) => { const URL = `/filament/show/${item.id}`; - return {label}; + return {formatFilament(item)}; + }; + + const formatTitle = (item: ISpool) => { + return `[Spool #${item.id}] ${formatFilament(item.filament)}`; }; return ( - + {t("spool.fields.id")} {t("spool.fields.filament")} - + {t("spool.fields.registered")} = () => { const record = data?.data; + const formatTitle = (item: IVendor) => { + return `[Vendor #${item.id}] ${item.name}`; + }; + return ( - + {t("vendor.fields.id")} {t("vendor.fields.registered")}