// Copyright 2017-2021 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React, { useCallback } from 'react'; import styled from 'styled-components'; import Labelled from './Labelled'; interface Props { children?: React.ReactNode; className?: string; help?: React.ReactNode; isError?: boolean; isReadOnly?: boolean; label?: React.ReactNode; onChange?: (arg: string) => void; seed?: string; withLabel?: boolean; } function TextArea ({ children, className, help, isError, isReadOnly, label, onChange, seed, withLabel }: Props): React.ReactElement { const _onChange = useCallback( ({ target: { value } }: React.ChangeEvent): void => { onChange && onChange(value); }, [onChange] ); return (