mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
The new `export` slug is now part of `SETTINGS_SECTION_SLUGS`, so the dynamic `/settings/[section]/page.tsx` route picks it up via `generateStaticParams()` and the existing 404-on-unknown guard. The shell sidebar gains a Download-iconed entry between API and Advanced; the placeholder fallback also learned the new icon so a future slug addition can't crash type-checking. The shell-test suite now expects ten sections (was nine) and asserts that `/settings/export` is a real link in the rendered nav. Old "advanced" copy already trimmed in the previous commit, so the export entry is the new home for every "give me my data out" path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29 lines
755 B
TypeScript
29 lines
755 B
TypeScript
/**
|
|
* Server-safe constants for the v1.4 settings split. Kept in a separate
|
|
* module from `<SettingsShell>` (a client component) so server-rendered code
|
|
* paths — `generateStaticParams()`, the page guard, future tests — can import
|
|
* the slug list without dragging the whole client bundle into the server
|
|
* graph.
|
|
*/
|
|
|
|
export const SETTINGS_SECTION_SLUGS = [
|
|
"account",
|
|
"integrations",
|
|
"notifications",
|
|
"dashboard",
|
|
"thresholds",
|
|
"ai",
|
|
"api",
|
|
"export",
|
|
"advanced",
|
|
"about",
|
|
] as const;
|
|
|
|
export type SettingsSectionSlug = (typeof SETTINGS_SECTION_SLUGS)[number];
|
|
|
|
export function isSettingsSectionSlug(
|
|
value: string,
|
|
): value is SettingsSectionSlug {
|
|
return (SETTINGS_SECTION_SLUGS as readonly string[]).includes(value);
|
|
}
|