Spaces:
Sleeping
Sleeping
Download src/components/base/Select/SelectValue.tsx from bradduy/edtechdemo: direct link, hf CLI and curl.
- Browser
- Download file 371 Bytes
-
https://huggingface.co/spaces/bradduy/edtechdemo/resolve/main/src/components/base/Select/SelectValue.tsx
- Command line
-
hf download hf://spaces/bradduy/edtechdemo/src/components/base/Select/SelectValue.tsx
-
curl -L -o SelectValue.tsx https://huggingface.co/spaces/bradduy/edtechdemo/resolve/main/src/components/base/Select/SelectValue.tsx
371 Bytes
| 'use client'; | |
| import * as React from 'react'; | |
| import { SelectContext } from './SelectContext'; | |
| export default function SelectValue({ placeholder }: { placeholder?: string }) { | |
| const context = React.useContext(SelectContext); | |
| if (!context) { | |
| throw new Error('SelectValue must be used within Select'); | |
| } | |
| return <span>{context.value || placeholder}</span>; | |
| } | |