import { jsx } from "react/jsx-runtime";
import { Confirm } from "@arcblock/ux/lib/Dialog";
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
import { Box } from "@mui/material";
export default function ConfirmDialog({
  onConfirm,
  onCancel,
  title,
  message,
  confirm = "",
  color = "error",
  cancel = "",
  loading = false
}) {
  const { t } = useLocaleContext();
  return /* @__PURE__ */ jsx(
    Confirm,
    {
      open: true,
      title,
      onConfirm,
      onCancel,
      confirmButton: {
        text: confirm || t("common.confirm"),
        props: { color, size: "small", variant: "contained", disabled: !!loading }
      },
      cancelButton: { text: cancel || t("common.cancel"), props: { color: "inherit", size: "small" } },
      showCancelButton: typeof cancel !== "boolean" || !!cancel,
      children: /* @__PURE__ */ jsx(Box, { children: message })
    }
  );
}
