Files
LingvAI/components/LangSelect.tsx
David 47aa0c3b0e Update dependencies again (#37)
* Initial Next update to canary

* Dependencies updated

* Dependencies updated for real
2021-08-28 15:55:41 +02:00

28 lines
662 B
TypeScript

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, null, 3]}
textAlign="center"
style={{ textAlignLast: "center" }}
{...props}
>
{langs.map(([code, name]) => (
<option value={code} key={code}>{name}</option>
))}
</Select>
);
export default LangSelect;