mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-16 10:03:12 -07:00
41 lines
1,006 B
JavaScript
41 lines
1,006 B
JavaScript
import {
|
|
Accordion,
|
|
AccordionSummary,
|
|
AccordionDetails,
|
|
Grid,
|
|
Typography,
|
|
Select,
|
|
} from "@material-ui/core";
|
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
import localesList from "generated/localesList.json";
|
|
|
|
function Settings() {
|
|
const { t, i18n } = useTranslation();
|
|
|
|
const handleChange = () => (event) => {
|
|
i18n.changeLanguage(event.target.value);
|
|
};
|
|
|
|
return (
|
|
<Accordion>
|
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
|
<Typography>{t("language")}</Typography>
|
|
</AccordionSummary>
|
|
<AccordionDetails>
|
|
<Grid item>
|
|
<Select native value={i18n.language} onChange={handleChange()}>
|
|
{localesList.map((locale) => (
|
|
<option key={locale.code} value={locale.code}>
|
|
{locale.name}
|
|
</option>
|
|
))}
|
|
</Select>
|
|
</Grid>
|
|
</AccordionDetails>
|
|
</Accordion>
|
|
);
|
|
}
|
|
|
|
export default Settings;
|