index.tsx 615 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import TextareaBox from '../TextareaBox';
  3. import Typography from '../Typography';
  4. import { ContentWrapper } from './styled';
  5. type Props = {
  6. t: (key: string) => string;
  7. onChange: (value: string) => void;
  8. value?: string;
  9. };
  10. const TextBox: React.FC<Props> = ({
  11. t,
  12. onChange,
  13. value,
  14. }: Props): React.ReactElement => (
  15. <>
  16. <ContentWrapper>
  17. <Typography variant="subtitle">{t('text')}</Typography>
  18. </ContentWrapper>
  19. <TextareaBox onChange={onChange} value={value} shouldFitContainer />
  20. </>
  21. );
  22. TextBox.defaultProps = {
  23. value: '',
  24. };
  25. export default TextBox;