Files
LingvAI/components/TranslationArea.tsx
2021-03-16 01:33:19 +01:00

24 lines
589 B
TypeScript

import { FC, ChangeEvent } from "react";
import { Textarea, useBreakpointValue } from "@chakra-ui/react";
type Props = {
value: string,
onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void,
readOnly?: true
[key: string]: any
};
const TranslationArea: FC<Props> = ({ value, onChange, readOnly, ...props }) => (
<Textarea
value={value}
onChange={onChange}
readOnly={readOnly}
resize="none"
rows={useBreakpointValue([6, null, 12]) ?? undefined}
size="lg"
{...props}
/>
);
export default TranslationArea;