Spaces:
Running
Running
| // A static list of regions we support. | |
| // Each object has a "code" (what we send to TMDB) and a "label" (what the user sees). | |
| const REGIONS = [ | |
| { code: 'US', label: '๐บ๐ธ USA' }, | |
| { code: 'GB', label: '๐ฌ๐ง UK' }, | |
| { code: 'CA', label: '๐จ๐ฆ Canada' }, | |
| { code: 'AU', label: '๐ฆ๐บ Australia' }, | |
| { code: 'IN', label: '๐ฎ๐ณ India' }, | |
| { code: 'DE', label: '๐ฉ๐ช Germany' }, | |
| { code: 'FR', label: '๐ซ๐ท France' }, | |
| { code: 'JP', label: '๐ฏ๐ต Japan' }, | |
| { code: 'BR', label: '๐ง๐ท Brazil' }, | |
| { code: 'MX', label: '๐ฒ๐ฝ Mexico' }, | |
| ] | |
| // RegionSelector receives: | |
| // region โ the currently selected country code (e.g. 'US') | |
| // setRegion โ a function to update it in App when the user picks a different country | |
| export default function RegionSelector({ region, setRegion }) { | |
| return ( | |
| <select | |
| value={region} | |
| onChange={e => setRegion(e.target.value)} | |
| className="w-full sm:w-auto bg-stone-900 border border-stone-700 rounded px-3 py-2.5 text-white focus:outline-none focus:border-amber-400 transition-colors" | |
| > | |
| {REGIONS.map(r => ( | |
| <option key={r.code} value={r.code}>{r.label}</option> | |
| ))} | |
| </select> | |
| ) | |
| } | |