import { j as l } from "../../node_modules/react/jsx-runtime.mjs";
import b, { useMemo as x } from "react";
import j from "../BitzDrawer/index.mjs";
import { isMobile as n } from "../../node_modules/react-device-detect/dist/lib.mjs";
import { useTranslation as B } from "../../node_modules/react-i18next/dist/es/useTranslation.mjs";
import i from "../../node_modules/antd/es/button/button.mjs";
const R = ({ open: s, title: f, drawerEmit: t = () => {
}, extra: e, requiredItems: o = [], children: r, ...p }) => {
  const { t: c } = B(), h = b.useRef(null), m = x(() => {
    if ((o == null ? void 0 : o.length) == 0)
      return !0;
    if ((o == null ? void 0 : o.length) > 0)
      return o.includes("") || o.includes(null) || o.includes(void 0);
  }, [o]);
  return /* @__PURE__ */ l.jsx(
    j,
    {
      className: "BitzTableDrawerBlock",
      ...p,
      title: f,
      placement: n ? "bottom" : "right",
      height: n ? "600" : "",
      width: n ? "" : "800",
      open: s,
      onClose: () => {
        t("cancel");
      },
      footer: /* @__PURE__ */ l.jsxs("div", { className: n ? "mobileFooter" : "pcFooter", children: [
        /* @__PURE__ */ l.jsx(
          i,
          {
            type: "primary",
            disabled: m,
            onClick: () => {
              t("confirm");
            },
            children: c("System_Save", "保存")
          }
        ),
        /* @__PURE__ */ l.jsx(
          i,
          {
            onClick: () => {
              var a;
              (a = h.current) == null || a.resetFields(), t("cancel");
            },
            children: c("System_Cancel", "取消")
          }
        )
      ] }),
      children: e || r
    }
  );
};
export {
  R as default
};
