12 lines
344 B
TypeScript
12 lines
344 B
TypeScript
import { useState } from 'react'
|
|
|
|
export type StyleConfig = { themeColor: string; showLogo: boolean }
|
|
|
|
export function useStyle() {
|
|
const [style, setStyle] = useState<StyleConfig>({ themeColor: '#2563eb', showLogo: true })
|
|
|
|
const update = (patch: Partial<StyleConfig>) => setStyle((s) => ({ ...s, ...patch }))
|
|
|
|
return { style, update }
|
|
}
|