|
1 | 1 | 'use client'; |
| 2 | +import { Check } from '@primeicons/react/check'; |
2 | 3 | import { Checkbox } from '@primereact/ui/checkbox'; |
3 | 4 | import { CheckboxGroup, type CheckboxGroupChangeEvent } from '@primereact/ui/checkboxgroup'; |
4 | 5 | import { Label } from '@primereact/ui/label'; |
5 | 6 | import React from 'react'; |
6 | | -import { Check } from '@primeicons/react/check'; |
| 7 | + |
| 8 | +const options = [ |
| 9 | + { label: 'Gemini', value: 'gemini' }, |
| 10 | + { label: 'Claude', value: 'claude' }, |
| 11 | + { label: 'ChatGPT', value: 'chatgpt' }, |
| 12 | + { label: 'Deepseek', value: 'deepseek' } |
| 13 | +]; |
7 | 14 |
|
8 | 15 | export default function BasicDemo() { |
9 | 16 | const [value, setValue] = React.useState<string[]>(); |
10 | 17 |
|
11 | 18 | return ( |
12 | 19 | <div className="flex items-center justify-center"> |
13 | | - <CheckboxGroup |
14 | | - defaultValue={['Cheese']} |
15 | | - value={value} |
16 | | - onValueChange={(e: CheckboxGroupChangeEvent) => setValue(e.value as string[])} |
17 | | - className="gap-4 flex-wrap" |
18 | | - > |
19 | | - <div className="flex items-center gap-2"> |
20 | | - <Checkbox.Root inputId="cheese" value="Cheese"> |
21 | | - <Checkbox.Box> |
22 | | - <Checkbox.Indicator match="checked"> |
23 | | - <Check /> |
24 | | - </Checkbox.Indicator> |
25 | | - </Checkbox.Box> |
26 | | - </Checkbox.Root> |
27 | | - <Label htmlFor="cheese">Cheese</Label> |
28 | | - </div> |
29 | | - <div className="flex items-center gap-2"> |
30 | | - <Checkbox.Root inputId="mushroom" value="Mushroom"> |
31 | | - <Checkbox.Box> |
32 | | - <Checkbox.Indicator match="checked"> |
33 | | - <Check /> |
34 | | - </Checkbox.Indicator> |
35 | | - </Checkbox.Box> |
36 | | - </Checkbox.Root> |
37 | | - <Label htmlFor="mushroom">Mushroom</Label> |
38 | | - </div> |
39 | | - <div className="flex items-center gap-2"> |
40 | | - <Checkbox.Root inputId="pepper" value="Pepper"> |
41 | | - <Checkbox.Box> |
42 | | - <Checkbox.Indicator match="checked"> |
43 | | - <Check /> |
44 | | - </Checkbox.Indicator> |
45 | | - </Checkbox.Box> |
46 | | - </Checkbox.Root> |
47 | | - <Label htmlFor="pepper">Pepper</Label> |
48 | | - </div> |
49 | | - <div className="flex items-center gap-2"> |
50 | | - <Checkbox.Root inputId="onion" value="Onion"> |
51 | | - <Checkbox.Box> |
52 | | - <Checkbox.Indicator match="checked"> |
53 | | - <Check /> |
54 | | - </Checkbox.Indicator> |
55 | | - </Checkbox.Box> |
56 | | - </Checkbox.Root> |
57 | | - <Label htmlFor="onion">Onion</Label> |
| 20 | + <div className="p-1 rounded-2xl bg-surface-100 dark:bg-surface-900 max-w-3xs"> |
| 21 | + <div className="px-2.5 pt-1 pb-1.5 text-sm font-semibold text-surface-500">Survey</div> |
| 22 | + <div className="p-4 rounded-xl bg-surface-0 dark:bg-surface-950"> |
| 23 | + <div className="mb-3 text-color">Which LLM provider should we integrate next?</div> |
| 24 | + <CheckboxGroup |
| 25 | + defaultValue={['Cheese']} |
| 26 | + value={value} |
| 27 | + onValueChange={(e: CheckboxGroupChangeEvent) => setValue(e.value as string[])} |
| 28 | + className="flex-col gap-2" |
| 29 | + > |
| 30 | + {options.map((option) => ( |
| 31 | + <div key={option.value} className="flex items-center gap-3"> |
| 32 | + <Checkbox.Root inputId={option.value} value={option.value}> |
| 33 | + <Checkbox.Box> |
| 34 | + <Checkbox.Indicator match="checked"> |
| 35 | + <Check /> |
| 36 | + </Checkbox.Indicator> |
| 37 | + </Checkbox.Box> |
| 38 | + </Checkbox.Root> |
| 39 | + <Label htmlFor={option.value} className="text-surface-500 dark:text-surface-400"> |
| 40 | + {option.label} |
| 41 | + </Label> |
| 42 | + </div> |
| 43 | + ))} |
| 44 | + </CheckboxGroup> |
58 | 45 | </div> |
59 | | - </CheckboxGroup> |
| 46 | + </div> |
60 | 47 | </div> |
61 | 48 | ); |
62 | 49 | } |
0 commit comments