WhereToWatch / src /components /RegionSelector.jsx
Nihal Nimmagadda
Make app responsive for mobile
73d1d38
// 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>
)
}