import { type Editor } from "@tiptap/react";

export interface EditorComponentProps {
  editor: Editor | null;
}

export interface MenuButtonProps {
  onClick: () => void;
  isActive?: boolean;
  disabled?: boolean;
  title?: string;
  children: React.ReactNode;
  className?: string;
}

export interface HeadingOption {
  label: string;
  level: 0 | 1 | 2 | 3 | 4 | 5 | 6;
}

export interface FontSizeOption {
  label: string;
  value: string;
}

export interface ColorOption {
  label: string;
  value: string;
}

export type ToolbarSection =
  | "history"
  | "heading"
  | "fontSize"
  | "basic"
  | "script"
  | "color"
  | "align"
  | "list"
  | "block"
  | "insert"
  | "table";

export interface TextEditorProps {
  /** Initial HTML content */
  content?: string;
  /** Called on every content change with the latest HTML */
  onChange?: (html: string) => void;
  /** Placeholder text shown when editor is empty */
  placeholder?: string;
  /** Disable editing (read-only mode) */
  editable?: boolean;
  /** Show the character/word count footer */
  showCharacterCount?: boolean;
  /** Max characters allowed (0 = unlimited) */
  characterLimit?: number;
  /** Extra class names for the outer wrapper */
  className?: string;
  /** Minimum height of the editable area */
  minHeight?: string;
  /** Maximum height before the editor scrolls internally (default 500px). Use "none" to disable. */
  maxHeight?: string;
  /** Callback fired with the editor instance once ready */
  onEditorReady?: (editor: Editor) => void;
}
