'use strict';

const jsxRuntime = require('react/jsx-runtime');
const form = require('../../form.cjs');
const _switch = require('../../switch.cjs');
const label = require('../common/label.cjs');
const tooltip = require('../common/tooltip.cjs');

function AutoFormSwitch({
  label: label$1,
  isRequired,
  field,
  fieldConfigItem,
  fieldProps
}) {
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
    /* @__PURE__ */ jsxRuntime.jsx(form.FormItem, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
      /* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
        _switch.Switch,
        {
          checked: field.value,
          onCheckedChange: field.onChange,
          ...fieldProps
        }
      ) }),
      /* @__PURE__ */ jsxRuntime.jsx(
        label,
        {
          label: fieldConfigItem?.label || label$1,
          isRequired
        }
      )
    ] }) }),
    /* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem })
  ] });
}

module.exports = AutoFormSwitch;
