MCPcopy Create free account
hub / github.com/evolify/dumpfun / ToggleGroup

Function ToggleGroup

common/components/toggle-group.tsx:27–62  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

25}
26
27export default function ToggleGroup(props: Props) {
28 const { value, onChange, responsive = true, options } = props
29
30 const isMobile = useMobile()
31 if (isMobile && responsive) {
32 return (
33 <Select value={value} onValueChange={onChange}>
34 <SelectTrigger className="w-[180px]">
35 <SelectValue placeholder="Select a fruit" />
36 </SelectTrigger>
37 <SelectContent>
38 {options.map(option => (
39 <SelectItem key={option.value} value={option.value}>
40 {option.label}
41 </SelectItem>
42 ))}
43 </SelectContent>
44 </Select>
45 )
46 }
47
48 return (
49 <_ToggleGroup
50 type="single"
51 variant="outline"
52 value={value}
53 onValueChange={onChange}
54 >
55 {options.map(option => (
56 <ToggleGroupItem key={option.value} value={option.value}>
57 {option.label}
58 </ToggleGroupItem>
59 ))}
60 </_ToggleGroup>
61 )
62}

Callers

nothing calls this directly

Calls 1

useMobileFunction · 0.90

Tested by

no test coverage detected