"use client"; import { memo } from "react"; import ReactMarkdown from "react-markdown"; import { Button } from "@kandev/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger } from "@kandev/ui/tooltip"; import { IconCode } from "@tabler/icons-react"; import { remarkPlugins, markdownComponents } from "@/components/shared/markdown-components"; import { toRelativePath } from "@/lib/utils"; import { PanelHeaderBarSplit } from "@/components/task/panel-primitives"; interface MarkdownPreviewToolbarProps { path: string; worktreePath?: string; onTogglePreview: () => void; } function MarkdownPreviewToolbar({ path, worktreePath, onTogglePreview, }: MarkdownPreviewToolbarProps) { return ( {toRelativePath(path, worktreePath)} Preview } right={
Show code
} /> ); } interface MarkdownPreviewContentProps { path: string; content: string; worktreePath?: string; onTogglePreview: () => void; } export const MarkdownPreviewContent = memo(function MarkdownPreviewContent({ path, content, worktreePath, onTogglePreview, }: MarkdownPreviewContentProps) { return (
{content}
); });