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