MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / ButtonToggle

Function ButtonToggle

apps/web/ui/ButtonToggle/index.tsx:19–43  ·  view source on GitHub ↗
({
  className,
  value,
  options,
  onChange,
}: Props)

Source from the content-addressed store, hash-verified

17}
18
19export 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

Calls 2

mapMethod · 0.80
onChangeFunction · 0.50

Tested by

no test coverage detected