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 u } from "../../node_modules/react-i18next/dist/es/useTranslation.mjs";
import a from "../../node_modules/antd/es/button/button.mjs";
const R = ({ open: s, title: e, drawerEmit: t = () => {
}, extra: f, requiredItems: o = [], children: p, ...r }) => {
  const { t: c } = u(), 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 l.jsx(j, { className: "BitzTableDrawerBlock", ...r, title: e, placement: n ? "bottom" : "right", height: n ? "600" : "", width: n ? "" : "800", open: s, onClose: () => {
    t("cancel");
  }, footer: l.jsxs("div", { className: n ? "mobileFooter" : "pcFooter", children: [l.jsx(a, { type: "primary", disabled: m, onClick: () => {
    t("confirm");
  }, children: c("System_Save", "保存") }), l.jsx(a, { onClick: () => {
    var i;
    (i = h.current) == null || i.resetFields(), t("cancel");
  }, children: c("System_Cancel", "取消") })] }), children: f || p });
};
export {
  R as default
};
