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:
27
decnet_web/src/components/Config/types.ts
Normal file
27
decnet_web/src/components/Config/types.ts
Normal 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';
|
||||
Reference in New Issue
Block a user