import { jsxs, jsx } from 'react/jsx-runtime';
import { useState } from 'react';
import { ImageIcon } from '../../../../../../../node_modules/.pnpm/@radix-ui_react-icons@1.3.2_react@19.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.mjs';
import { ToolbarButton } from '../toolbar-button.mjs';
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '../../../dialog.mjs';
import { ImageEditBlock } from './image-edit-block.mjs';

const ImageEditDialog = ({ editor, size, variant }) => {
  const [open, setOpen] = useState(false);
  return /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: setOpen, children: [
    /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
      ToolbarButton,
      {
        isActive: editor.isActive("image"),
        tooltip: "Image",
        "aria-label": "Image",
        size,
        variant,
        children: /* @__PURE__ */ jsx(ImageIcon, { className: "size-5" })
      }
    ) }),
    /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-lg", children: [
      /* @__PURE__ */ jsxs(DialogHeader, { children: [
        /* @__PURE__ */ jsx(DialogTitle, { children: "Select image" }),
        /* @__PURE__ */ jsx(DialogDescription, { className: "sr-only", children: "Upload an image from your computer" })
      ] }),
      /* @__PURE__ */ jsx(ImageEditBlock, { editor, close: () => setOpen(false) })
    ] })
  ] });
};

export { ImageEditDialog };
