Spaces:
Sleeping
Sleeping
Download frontend/src/components/StoreNameSelect.jsx from Caner7/Muhasebe: direct link, hf CLI and curl.
- Browser
- Download file 746 Bytes
-
https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/components/StoreNameSelect.jsx
- Command line
-
hf download hf://spaces/Caner7/Muhasebe/frontend/src/components/StoreNameSelect.jsx
-
curl -L -o StoreNameSelect.jsx https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/components/StoreNameSelect.jsx
746 Bytes
| import { STORE_OPTIONS } from "../constants/app.js"; | |
| /** Sipariş formlarında mağaza seçimi; bilinen liste + mevcut kayıttan gelen özel değer. */ | |
| export function StoreNameSelect({ value, onChange }) { | |
| const v = String(value ?? ""); | |
| const known = STORE_OPTIONS.includes(v); | |
| return ( | |
| <select | |
| className="store-name-select" | |
| value={known || v === "" ? v : v} | |
| onChange={(e) => onChange(e.target.value)} | |
| aria-label="Magaza" | |
| > | |
| <option value="">Magaza secin</option> | |
| {STORE_OPTIONS.map((name) => ( | |
| <option key={name} value={name}> | |
| {name} | |
| </option> | |
| ))} | |
| {!known && v ? ( | |
| <option value={v}>{v} (mevcut kayit)</option> | |
| ) : null} | |
| </select> | |
| ); | |
| } | |