@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
8 lines (7 loc) • 821 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { DatePicker } from '../../../../components';
const DateInput = React.forwardRef(({ field, error, ...props }, ref) => {
return (_jsxs(_Fragment, { children: [_jsx("label", { htmlFor: field.name, className: "mb-1 block text-sm font-medium text-gray-700", children: field.label }), _jsx(DatePicker, { ...props, ref: ref, id: field.name, disabled: field.disabled, placeholder: field.placeholder, className: `mt-1 block w-full p-2 ${error ? 'border-red-500' : 'border-gray-300'} rounded-md shadow-sm disabled:text-gray-400 disabled:bg-gray-50 disabled:cursor-not-allowed` }), error && _jsx("p", { className: "mt-2 text-sm text-red-500", children: error.message })] }));
});
export default DateInput;