CI / changes (push) Successful in 8s
CI / commitlint (push) Skipped
CI / openapi (push) Successful in 40s
CI / web (push) Successful in 55s
CI / go (push) Successful in 1m9s
CI / bird2 (push) Successful in 16s
CI / release (push) Successful in 4m6s
Refactored the settings components to unify navigation between UI and BIRD settings. Updated tab structures to streamline access and improve user experience. Adjusted routing and search parameters to reflect the new tab organization, ensuring a cohesive interface. Removed legacy tenant settings references and enhanced the settings page layout for clarity and usability.
33 lines
898 B
TypeScript
33 lines
898 B
TypeScript
import { ServerCogIcon, SettingsIcon } from 'lucide-react'
|
|
import { type ReactNode } from 'react'
|
|
|
|
export type SettingsSection = 'ui' | 'bird'
|
|
|
|
export type SettingsTabItem = {
|
|
value: SettingsSection
|
|
label: string
|
|
icon: ReactNode
|
|
}
|
|
|
|
/** Side rail items — settings-7 AccountSettings DNA. */
|
|
export const SETTINGS_TAB_ITEMS: SettingsTabItem[] = [
|
|
{
|
|
value: 'ui',
|
|
label: 'Настройки UI',
|
|
icon: <SettingsIcon aria-hidden="true" />,
|
|
},
|
|
{
|
|
value: 'bird',
|
|
label: 'Настройки BIRD',
|
|
icon: <ServerCogIcon aria-hidden="true" />,
|
|
},
|
|
]
|
|
|
|
const LEGACY_BIRD = new Set(['bird', 'revision', 'runtime-logs', 'additional'])
|
|
|
|
/** Maps current and legacy `?tab=` values onto the unified settings rail. */
|
|
export function parseSettingsSection(value: unknown): SettingsSection {
|
|
if (typeof value === 'string' && LEGACY_BIRD.has(value)) return 'bird'
|
|
return 'ui'
|
|
}
|