Initial theme designed
This commit is contained in:
26
components/LangSelect.tsx
Normal file
26
components/LangSelect.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { FC, ChangeEvent } from "react";
|
||||
import { Select } from "@chakra-ui/react";
|
||||
|
||||
type Props = {
|
||||
value: string,
|
||||
onChange: (e: ChangeEvent<any>) => void,
|
||||
langs: [string, string][],
|
||||
[key: string]: any
|
||||
};
|
||||
|
||||
const LangSelect: FC<Props> = ({ value, onChange, langs, ...props }) => (
|
||||
<Select
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
variant="flushed"
|
||||
px={2}
|
||||
textAlign="center"
|
||||
{...props}
|
||||
>
|
||||
{langs.map(([code, name]) => (
|
||||
<option value={code} key={code}>{name}</option>
|
||||
))}
|
||||
</Select>
|
||||
);
|
||||
|
||||
export default LangSelect;
|
||||
Reference in New Issue
Block a user