UNPKG

@pagamio/frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

6 lines (5 loc) 752 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import React from 'react'; import { Textarea } from '../../../../components'; const TextareaInputFW = React.forwardRef(({ field, error, ...props }, ref) => (_jsxs("div", { ref: ref, children: [_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-gray-700", children: field.label }), _jsx(Textarea, { className: `mt-1 block w-full p-2 border ${error ? 'border-red-500' : 'border-gray-300'} rounded-md shadow-sm disabled:text-gray-400 disabled:bg-gray-50`, ...props, placeholder: field?.placeholder ?? ' ', disabled: field.disabled }), error && _jsx("p", { className: "mt-2 text-sm text-red-500", children: error.message })] }))); export default TextareaInputFW;