import { jsx } from 'react/jsx-runtime';
import { DotsHorizontalIcon, FontBoldIcon, FontItalicIcon, UnderlineIcon, StrikethroughIcon, CodeIcon, TextNoneIcon } 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 { ToolbarSection } from '../toolbar-section.mjs';

const formatActions = [
  {
    value: "bold",
    label: "Bold",
    icon: /* @__PURE__ */ jsx(FontBoldIcon, { className: "size-5" }),
    action: (editor) => editor.chain().focus().toggleBold().run(),
    isActive: (editor) => editor.isActive("bold"),
    canExecute: (editor) => editor.can().chain().focus().toggleBold().run() && !editor.isActive("codeBlock"),
    shortcuts: ["mod", "B"]
  },
  {
    value: "italic",
    label: "Italic",
    icon: /* @__PURE__ */ jsx(FontItalicIcon, { className: "size-5" }),
    action: (editor) => editor.chain().focus().toggleItalic().run(),
    isActive: (editor) => editor.isActive("italic"),
    canExecute: (editor) => editor.can().chain().focus().toggleItalic().run() && !editor.isActive("codeBlock"),
    shortcuts: ["mod", "I"]
  },
  {
    value: "underline",
    label: "Underline",
    icon: /* @__PURE__ */ jsx(UnderlineIcon, { className: "size-5" }),
    action: (editor) => editor.chain().focus().toggleUnderline().run(),
    isActive: (editor) => editor.isActive("underline"),
    canExecute: (editor) => editor.can().chain().focus().toggleUnderline().run() && !editor.isActive("codeBlock"),
    shortcuts: ["mod", "U"]
  },
  {
    value: "strikethrough",
    label: "Strikethrough",
    icon: /* @__PURE__ */ jsx(StrikethroughIcon, { className: "size-5" }),
    action: (editor) => editor.chain().focus().toggleStrike().run(),
    isActive: (editor) => editor.isActive("strike"),
    canExecute: (editor) => editor.can().chain().focus().toggleStrike().run() && !editor.isActive("codeBlock"),
    shortcuts: ["mod", "shift", "S"]
  },
  {
    value: "code",
    label: "Code",
    icon: /* @__PURE__ */ jsx(CodeIcon, { className: "size-5" }),
    action: (editor) => editor.chain().focus().toggleCode().run(),
    isActive: (editor) => editor.isActive("code"),
    canExecute: (editor) => editor.can().chain().focus().toggleCode().run() && !editor.isActive("codeBlock"),
    shortcuts: ["mod", "E"]
  },
  {
    value: "clearFormatting",
    label: "Clear formatting",
    icon: /* @__PURE__ */ jsx(TextNoneIcon, { className: "size-5" }),
    action: (editor) => editor.chain().focus().unsetAllMarks().run(),
    isActive: () => false,
    canExecute: (editor) => editor.can().chain().focus().unsetAllMarks().run() && !editor.isActive("codeBlock"),
    shortcuts: ["mod", "\\"]
  }
];
const SectionTwo = ({
  editor,
  activeActions = formatActions.map((action) => action.value),
  mainActionCount = 2,
  size,
  variant
}) => {
  return /* @__PURE__ */ jsx(
    ToolbarSection,
    {
      editor,
      actions: formatActions,
      activeActions,
      mainActionCount,
      dropdownIcon: /* @__PURE__ */ jsx(DotsHorizontalIcon, { className: "size-5" }),
      dropdownTooltip: "More formatting",
      dropdownClassName: "w-8",
      size,
      variant
    }
  );
};
SectionTwo.displayName = "SectionTwo";

export { SectionTwo, SectionTwo as default };
