CI / changes (push) Successful in 10s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Successful in 54s
CI / go (push) Successful in 1m3s
CI / bird2 (push) Successful in 20s
CI / release (push) Successful in 4m29s
Updated the Settings and Auth components to include better navigation handling by adding search parameters for tab selection. Enhanced the Access component to utilize badges for status indicators, improving visual clarity. Refactored the Schedule component to streamline job status display with badges, ensuring a more cohesive user experience. Additionally, integrated client directives in UI components for better performance.
50 lines
1.0 KiB
TypeScript
50 lines
1.0 KiB
TypeScript
import {
|
|
KeyRoundIcon,
|
|
MonitorSmartphoneIcon,
|
|
PaletteIcon,
|
|
SlidersHorizontalIcon,
|
|
} from 'lucide-react'
|
|
import { type ReactNode } from 'react'
|
|
|
|
export type SettingsTab = 'connection' | 'session' | 'appearance' | 'sections'
|
|
|
|
export type SettingsTabItem = {
|
|
value: SettingsTab
|
|
label: string
|
|
icon: ReactNode
|
|
}
|
|
|
|
export const SETTINGS_TAB_ITEMS: SettingsTabItem[] = [
|
|
{
|
|
value: 'connection',
|
|
label: 'Подключение',
|
|
icon: <KeyRoundIcon aria-hidden="true" />,
|
|
},
|
|
{
|
|
value: 'session',
|
|
label: 'Сессия',
|
|
icon: <MonitorSmartphoneIcon aria-hidden="true" />,
|
|
},
|
|
{
|
|
value: 'appearance',
|
|
label: 'Оформление',
|
|
icon: <PaletteIcon aria-hidden="true" />,
|
|
},
|
|
{
|
|
value: 'sections',
|
|
label: 'Разделы',
|
|
icon: <SlidersHorizontalIcon aria-hidden="true" />,
|
|
},
|
|
]
|
|
|
|
export function parseSettingsTab(value: unknown): SettingsTab {
|
|
if (
|
|
value === 'session' ||
|
|
value === 'appearance' ||
|
|
value === 'sections'
|
|
) {
|
|
return value
|
|
}
|
|
return 'connection'
|
|
}
|