Brandon Presley
38332c193c
Select.tsx was crashing if it couldn't find a label for the selected value.
18 lines
351 B
TypeScript
18 lines
351 B
TypeScript
import {createContext, useContext} from 'react'
|
|
|
|
export const ThemeContext = createContext<{
|
|
theme: string
|
|
color: string
|
|
setTheme: (value: string) => void
|
|
setColor: (value: string) => void
|
|
}>({
|
|
theme: 'system',
|
|
color: '',
|
|
setTheme: () => null,
|
|
setColor: () => null,
|
|
})
|
|
|
|
export function useTheme() {
|
|
return useContext(ThemeContext)
|
|
}
|