@lunit/oui
Version:
Lunit Oncology UI components
10 lines (9 loc) • 714 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { InputMsg, BaseTextFieldContainer } from '../BaseTextField/BaseTextField.styled';
import BaseTextArea from './TextArea.styled';
const TextArea = forwardRef((props, ref) => {
const { error, helperMsg, OuterBoxProps, ...areaProps } = props;
return (_jsxs(BaseTextFieldContainer, { ...OuterBoxProps, width: props.width, children: [_jsx(BaseTextArea, { ref: ref, ...areaProps, multiline: "true", error: !!error }), error ? (_jsx(InputMsg, { variant: "body5", error: true, children: error })) : (helperMsg && _jsx(InputMsg, { variant: "body5", children: helperMsg }))] }));
});
export default TextArea;