"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Input = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importStar(require("react"));
const Input = ({ autoFocus, className, disabled, prefix, register, ...rest }) => {
    const inputRef = (0, react_1.useRef)(null);
    (0, react_1.useEffect)(() => {
        var _a;
        if (!disabled) {
            (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
        }
    }, [disabled]);
    return (react_1.default.createElement("div", { 
        // eslint-disable-next-line prettier/prettier
        className: `shadow-sm relative flex items-center rounded-lg border border-gray-500 bg-white ${prefix ? 'pl-3' : ''} ${className} ` },
        prefix && react_1.default.createElement("div", { className: ' text-xs text-gray-600' }, prefix),
        react_1.default.createElement("input", { ref: inputRef, ...register, ...rest, autoFocus: autoFocus, className: 'w-full  rounded-lg border-none text-xs font-normal focus:border-none  focus:outline-none focus:ring-transparent', disabled: disabled })));
};
exports.Input = Input;
//# sourceMappingURL=input.js.map