@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
6 lines (5 loc) • 751 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { Input } from '../../../../components';
const TimeInput = React.forwardRef(({ field, error, ...props }, ref) => (_jsxs(_Fragment, { children: [_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-gray-700", children: field.label }), _jsx(Input, { type: "time", ...props, ref: ref, id: field.name, disabled: field.disabled, 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` }), error && _jsx("p", { className: "mt-2 text-sm text-red-500", children: error.message })] })));
export default TimeInput;