feature: sk-react-toolkit holds the server helpers, web components and Vite font plugin shared by manage-ui and sql-query-webui.
Release / release (push) Failing after 1m18s

This commit is contained in:
slawek committed 2026-10-28 19:08:10 +01:00
commit 4505b37abc
30 files changed
+4826

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import DarkMode from '@mui/icons-material/DarkMode'
import LightMode from '@mui/icons-material/LightMode'
import SettingsBrightness from '@mui/icons-material/SettingsBrightness'
import { IconButton, Tooltip, useColorScheme } from '@mui/material'
import type { ReactNode } from 'react'
type Mode = 'light' | 'dark' | 'system'
const NEXT: Record<Mode, Mode> = { light: 'dark', dark: 'system', system: 'light' }
const ICONS: Record<Mode, ReactNode> = { light: <LightMode />, dark: <DarkMode />, system: <SettingsBrightness /> }
/** An icon button cycling light, dark and system theme. MUI stores the choice; mode is undefined on the first render. */
export default function ThemeMenu() {
const { mode, setMode } = useColorScheme()
if (!mode) {
return null
}
return (
<Tooltip title={`Theme: ${mode}. Switch to ${NEXT[mode]}.`}>
<IconButton aria-label={`theme ${mode}, switch to ${NEXT[mode]}`} onClick={() => setMode(NEXT[mode])}>
{ICONS[mode]}
</IconButton>
</Tooltip>
)
}