import { jsx, jsxs } from "react/jsx-runtime";
import { useState, useCallback } from "react";
import {
  DSDialog,
  DSDialogBody,
  DSDialogDefaultLayout,
  DSDialogPrimaryMessage,
  DSDialogSecondaryMessage
} from "@elliemae/ds-dialog";
import { ErrorHexegon } from "@elliemae/ds-icons";
const Error = ({
  open,
  primaryMessage,
  secondaryMessage
}) => {
  const [isOpen, setOpen] = useState(open);
  const handleClick = useCallback(() => {
    setOpen((prev) => !prev);
  }, []);
  return /* @__PURE__ */ jsx(DSDialog, { isOpen, onClickOutside: handleClick, size: "small", children: /* @__PURE__ */ jsx(DSDialogBody, { p: "s", children: /* @__PURE__ */ jsxs(DSDialogDefaultLayout, { children: [
    /* @__PURE__ */ jsx(ErrorHexegon, { size: "xxl", color: ["danger", "900"] }),
    /* @__PURE__ */ jsx(DSDialogPrimaryMessage, { children: primaryMessage }),
    secondaryMessage && /* @__PURE__ */ jsx(DSDialogSecondaryMessage, { children: secondaryMessage })
  ] }) }) });
};
export {
  Error
};
