refactor(decnet_web/Config): extract types

Foundation for the Config split. UserEntry / ConfigData move out
of the page so the upcoming hook + tab extractions can import
without reaching back through Config.tsx. New ConfigTab union and
FormMsg type for the inline success/error chip pattern that
repeats across every admin form on the page.

- New Config/types.ts (UserEntry, ConfigData, ConfigTab, FormMsg)
- Config.tsx loses the inline interfaces and the `as any` cast on
  setActiveTab in the tab-switcher.
This commit is contained in:
2026-05-09 05:19:50 -04:00
parent 6ba12cc571
commit 209efd1a74
2 changed files with 30 additions and 16 deletions

View File

@@ -0,0 +1,27 @@
/** Wire + UI types for the Config page surface. */
export interface UserEntry {
uuid: string;
username: string;
role: string;
must_change_password: boolean;
}
export interface ConfigData {
role: string;
deployment_limit: number;
global_mutation_interval: string;
users?: UserEntry[];
developer_mode?: boolean;
}
/** Inline success/error chip surfaced under each form section. */
export type FormMsg = { type: 'success' | 'error'; text: string };
export type ConfigTab =
| 'limits'
| 'users'
| 'globals'
| 'appearance'
| 'workers'
| 'ttp';