"use client" import { Button } from "@/components/ui/button" import { Separator } from "@/components/ui/separator" import { Bold, Italic, Strikethrough, Code, Link, ImageIcon, List, ListOrdered, Quote, Heading1, Heading2, Heading3, Minus, Table, } from "lucide-react" interface MarkdownToolbarProps { onInsertText: (before: string, after?: string, placeholder?: string) => void } export function MarkdownToolbar({ onInsertText }: MarkdownToolbarProps) { const toolbarItems = [ { group: "text", color: "from-red-500 to-pink-500", items: [ { icon: Bold, label: "Bold", action: () => onInsertText("**", "**", "bold text") }, { icon: Italic, label: "Italic", action: () => onInsertText("*", "*", "italic text") }, { icon: Strikethrough, label: "Strikethrough", action: () => onInsertText("~~", "~~", "strikethrough text") }, { icon: Code, label: "Inline Code", action: () => onInsertText("`", "`", "code") }, ], }, { group: "headings", color: "from-blue-500 to-cyan-500", items: [ { icon: Heading1, label: "Heading 1", action: () => onInsertText("# ", "", "Heading 1") }, { icon: Heading2, label: "Heading 2", action: () => onInsertText("## ", "", "Heading 2") }, { icon: Heading3, label: "Heading 3", action: () => onInsertText("### ", "", "Heading 3") }, ], }, { group: "lists", color: "from-green-500 to-emerald-500", items: [ { icon: List, label: "Bullet List", action: () => onInsertText("- ", "", "List item") }, { icon: ListOrdered, label: "Numbered List", action: () => onInsertText("1. ", "", "List item") }, { icon: Quote, label: "Quote", action: () => onInsertText("> ", "", "Quote text") }, ], }, { group: "media", color: "from-purple-500 to-indigo-500", items: [ { icon: Link, label: "Link", action: () => onInsertText("[", "](url)", "link text") }, { icon: ImageIcon, label: "Image", action: () => onInsertText("", "alt text") }, { icon: Minus, label: "Horizontal Rule", action: () => onInsertText("\n---\n") }, { icon: Table, label: "Table", action: () => onInsertText("\n| Header 1 | Header 2 |\n|----------|----------|\n| Cell 1 | Cell 2 |\n"), }, ], }, ] return (