1+ import { useId } from 'react'
2+
13import splitbee from '@splitbee/web'
24
3- import { type GraphData , DisplayName , GraphSize } from '../../types'
5+ import { DisplayName , type GraphData , GraphSize } from '../../types'
46import type useSetting from '../../useSetting'
57import ThemeSelector from '../ThemeSelector'
68import { RadixSelect } from '../ui-kit/RadixSelect'
@@ -10,7 +12,7 @@ import { RadixToggleGroup } from '../ui-kit/RadixToggleGroup'
1012type State = ReturnType < typeof useSetting > [ 0 ]
1113type Dispatch = ReturnType < typeof useSetting > [ 1 ]
1214
13- export interface AppearanceSettingProps {
15+ interface AppearanceSettingProps {
1416 value ?: State
1517 onChange ?: Dispatch
1618 graphData : GraphData | undefined
@@ -21,6 +23,8 @@ export default function AppearanceSetting({
2123 onChange : dispatch ,
2224 graphData,
2325} : AppearanceSettingProps ) {
26+ const attribution = useId ( )
27+
2428 return (
2529 < div className = "appearance-setting min-w-[min(40vw,220px)] max-w-[min(90vw,280px)] text-main-400" >
2630 < fieldset >
@@ -49,11 +53,11 @@ export default function AppearanceSetting({
4953 </ fieldset >
5054
5155 < fieldset >
52- < label htmlFor = " attribution" > Attribution</ label >
56+ < label htmlFor = { attribution } > Attribution</ label >
5357 < RadixSwitch
5458 checked = { settings ?. showAttribution }
5559 defaultChecked = { true }
56- id = " attribution"
60+ id = { attribution }
5761 onCheckedChange = { ( checked ) => dispatch ?.( { type : 'showAttribution' , payload : checked } ) }
5862 />
5963 </ fieldset >
0 commit comments