1
0
Fork 0
freesewing/sites/shared/components/workbench/menus/ui-settings/inputs.mjs

22 lines
506 B
JavaScript
Raw Normal View History

import { ListInput, BoolInput } from '../shared/inputs'
import { useControlState } from 'shared/components/account/control.mjs'
2023-05-31 17:56:58 +02:00
export const ControlSettingInput = (props) => {
const { selection, update } = useControlState()
2023-05-31 17:56:58 +02:00
props.config.dflt = selection
2023-05-31 17:56:58 +02:00
return (
<ListInput
{...props}
updateFunc={(path, newVal) => update(newVal)}
current={selection}
compact={selection < 2}
/>
2023-05-31 17:56:58 +02:00
)
}
export const inputs = {
renderer: ListInput,
control: ControlSettingInput,
}