@conduction/components
Version:
React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)
5 lines (4 loc) • 633 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { ErrorMessage } from "./errorMessage/ErrorMessage";
import { Textarea as UtrechtTextarea } from "@utrecht/component-library-react/dist/css-module";
export const Textarea = ({ name, validation, register, errors, disabled, defaultValue, hideErrorMessage, ariaLabel, }) => (_jsxs(_Fragment, { children: [_jsx(UtrechtTextarea, { ...register(name, { ...validation }), disabled, defaultValue, invalid: !!errors[name], "aria-label": ariaLabel }), errors[name] && !hideErrorMessage && _jsx(ErrorMessage, { message: errors[name]?.message })] }));