Files
Compass/web/components/language/language-picker.tsx
Martin Braquet ba9b3cfb06 Add pretty formatting (#29)
* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
2026-02-20 17:32:27 +01:00

29 lines
663 B
TypeScript

'use client'
import clsx from 'clsx'
import {LOCALES} from 'common/constants'
import {useLocale} from 'web/lib/locale'
export function LanguagePicker(props: {className?: string} = {}) {
const {className} = props
const {locale, setLocale} = useLocale()
return (
<select
id="locale-picker"
value={locale}
onChange={(e) => setLocale(e.target.value)}
className={clsx(
'rounded-md border border-gray-300 px-2 py-1 text-sm bg-canvas-50',
className,
)}
>
{Object.entries(LOCALES).map(([key, v]) => (
<option key={key} value={key}>
{v}
</option>
))}
</select>
)
}