import { X, Printer } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { MarkdownRenderer } from '@/components/preview/MarkdownRenderer'; import { useExportSource } from '@/hooks/use-export-source'; import { ipc } from '@/lib/ipc'; interface Props { onClose: () => void; } export function PrintPreview({ onClose }: Props) { const source = useExportSource(); const handlePrint = async () => { if (!source) return; // The print flow goes through the main process so the user gets the // native OS print dialog (with system paper-size, scale, and margins). // We send a simple "trigger do-print" message and let the main process // call webContents.print() with the user-chosen options. ipc.print.doPrint({ withStyles: true }); }; if (!source) { return (