'use client'; import { Copy, Share2, Image as ImageIcon, FileCode, QrCode } from 'lucide-react'; import { cn, actionBtn } from '@/lib/utils'; import type { ExportSize } from '@/types/qrcode'; interface QRPreviewProps { svgString: string; isGenerating: boolean; exportSize: ExportSize; onExportSizeChange: (size: ExportSize) => void; onCopyImage: () => void; onShare: () => void; onDownloadPng: () => void; onDownloadSvg: () => void; } const EXPORT_SIZES: { value: ExportSize; label: string }[] = [ { value: 256, label: '256' }, { value: 512, label: '512' }, { value: 1024, label: '1k' }, { value: 2048, label: '2k' }, ]; export function QRPreview({ svgString, isGenerating, exportSize, onExportSizeChange, onCopyImage, onShare, onDownloadPng, onDownloadSvg, }: QRPreviewProps) { return (
{/* Action bar */}
Preview {/* PNG + inline size selector */}
{EXPORT_SIZES.map(({ value, label }) => ( ))}
{/* QR canvas */}
{isGenerating ? (
) : svgString ? (
) : (

No QR code yet

Enter text or a URL to generate

)}
); }