Files
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

46 lines
1.3 KiB
JavaScript

import * as React from 'react';
import TablePagination from '@mui/material/TablePagination';
import Autocomplete from '@mui/material/Autocomplete';
import Box from '@mui/material/Box';
import TextField from '@mui/material/TextField';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';
import * as locales from '@mui/material/locale';
export default function Locales() {
const [locale, setLocale] = React.useState('zhCN');
const theme = useTheme();
const themeWithLocale = React.useMemo(
() => createTheme(theme, locales[locale]),
[locale, theme],
);
return (
<Box sx={{ width: '100%' }}>
<ThemeProvider theme={themeWithLocale}>
<Autocomplete
options={Object.keys(locales)}
getOptionLabel={(key) => `${key.substring(0, 2)}-${key.substring(2, 4)}`}
style={{ width: 300 }}
value={locale}
disableClearable
onChange={(event, newValue) => {
setLocale(newValue);
}}
renderInput={(params) => (
<TextField {...params} label="Locale" fullWidth />
)}
/>
<TablePagination
count={2000}
rowsPerPage={10}
page={1}
component="div"
onPageChange={() => {}}
/>
</ThemeProvider>
</Box>
);
}