MCPcopy
hub / github.com/premieroctet/openchakra / SizeControl

Function SizeControl

src/components/inspector/controls/SizeControl.tsx:16–35  ·  view source on GitHub ↗
(props: SizeControlPropsType)

Source from the content-addressed store, hash-verified

14const options = ['xs', 'sm', 'md', 'lg']
15
16const SizeControl = (props: SizeControlPropsType) => {
17 const { setValueFromEvent } = useForm()
18 const choices = props.options || options
19
20 return (
21 <FormControl label={props.label} htmlFor={props.name || 'size'}>
22 <Select
23 size="sm"
24 id={props.name || 'size'}
25 name={props.name || 'size'}
26 value={props.value || ''}
27 onChange={setValueFromEvent}
28 >
29 {choices.map(choice => (
30 <option key={choice}>{choice}</option>
31 ))}
32 </Select>
33 </FormControl>
34 )
35}
36
37export default SizeControl

Callers

nothing calls this directly

Calls 1

useFormFunction · 0.90

Tested by

no test coverage detected