repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
Projectflow
stars
latest
clone command
git clone gitlawb://did:key:z6Mkfh4Y...QBEi/projectflowgit clone gitlawb://did:key:z6Mkfh4Y.../projectflowb3cded1async from playground1d ago| import clsx from "clsx"; |
| #2 |
| #3 | export function Select({ |
| #4 | value, |
| #5 | onChange, |
| #6 | options, |
| #7 | placeholder, |
| #8 | className, |
| #9 | }: { |
| #10 | value: string; |
| #11 | onChange: (value: string) => void; |
| #12 | options: { value: string; label: string }[]; |
| #13 | placeholder?: string; |
| #14 | className?: string; |
| #15 | }) { |
| #16 | return ( |
| #17 | <select |
| #18 | value={value} |
| #19 | onChange={(e) => onChange(e.target.value)} |
| #20 | className={clsx("input appearance-none cursor-pointer", className)} |
| #21 | > |
| #22 | {placeholder && ( |
| #23 | <option value="" className="bg-surface-2"> |
| #24 | {placeholder} |
| #25 | </option> |
| #26 | )} |
| #27 | {options.map((opt) => ( |
| #28 | <option key={opt.value} value={opt.value} className="bg-surface-2"> |
| #29 | {opt.label} |
| #30 | </option> |
| #31 | ))} |
| #32 | </select> |
| #33 | ); |
| #34 | } |
| #35 |