()
| 3 | import { useSettings } from '@flow/reader/state' |
| 4 | |
| 5 | export function useSourceColor() { |
| 6 | const [{ theme }, setSettings] = useSettings() |
| 7 | |
| 8 | const setSourceColor = useCallback( |
| 9 | (source: string) => { |
| 10 | setSettings((prev) => ({ |
| 11 | ...prev, |
| 12 | theme: { |
| 13 | ...prev.theme, |
| 14 | source, |
| 15 | }, |
| 16 | })) |
| 17 | }, |
| 18 | [setSettings], |
| 19 | ) |
| 20 | |
| 21 | return { sourceColor: theme?.source ?? '#0ea5e9', setSourceColor } |
| 22 | } |
no test coverage detected