Function
ButtonToggle
({
className,
value,
options,
onChange,
}: Props)
Source from the content-addressed store, hash-verified
| 17 | } |
| 18 | |
| 19 | export default function ButtonToggle({ |
| 20 | className, |
| 21 | value, |
| 22 | options, |
| 23 | onChange, |
| 24 | }: Props) { |
| 25 | return ( |
| 26 | <ButtonGroup className={className}> |
| 27 | {options.map((option, index) => { |
| 28 | return ( |
| 29 | <Button |
| 30 | key={`${option.label}-${index}`} |
| 31 | className={styles.button} |
| 32 | color={option.value === value ? 'white' : 'transparent'} |
| 33 | size="xs" |
| 34 | onClick={() => onChange(option.value)} |
| 35 | > |
| 36 | {option.icon} |
| 37 | {option.label} |
| 38 | </Button> |
| 39 | ); |
| 40 | })} |
| 41 | </ButtonGroup> |
| 42 | ); |
| 43 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected