import React from 'react' ; import { Props } from './TextArea.types' ; import { InfoIcon , TextAreaStyled } from './TextArea.style' ; import { Wrapper } from '../Wrapper/Wrapper' ; import { Focus , withIris , } from '../../../utils' ; export const TextArea = withIris < HTMLInputElement , Props > ( TextAreaComponent ) ; function TextAreaComponent ( { disabled , errorMsg , forwardRef , format , messages , helperMsg , id , label , preMessage , ... props } ) { return ( < Wrapper disabled = { disabled } label = { label } messages = { messages } status = { format } > < div style = { { position : 'relative' } } > < TextAreaStyled id = { id } aria - label = { label } aria - invalid = { format === 'negative' } disabled = { disabled } hasIcon = { format === 'negative' } format = { format } ref = { forwardRef } { ... props } /> { format === 'negative' ? < InfoIcon /> : null} < Focus parent = { TextAreaStyled } / > < /div> < /Wrapper>); }