"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _jsxRuntime = require("react/jsx-runtime");
function FormField(_ref) {
  let label = _ref.label,
    name = _ref.name,
    _ref$type = _ref.type,
    type = _ref$type === void 0 ? 'text' : _ref$type,
    placeholder = _ref.placeholder,
    testId = _ref.testId,
    errorTestId = _ref.errorTestId,
    value = _ref.value,
    error = _ref.error,
    onChange = _ref.onChange;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
    children: [label, /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
      type: type,
      "data-testid": testId,
      name: name,
      placeholder: placeholder,
      value: value,
      onChange: onChange
    }), error && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      className: "field-error",
      "data-testid": errorTestId,
      children: error
    })]
  });
}
var _default = exports.default = FormField;