'use client'; import { Copy, Share2, Image as ImageIcon, FileCode, QrCode } from 'lucide-react'; import { cn } from '@/lib/utils/cn'; 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' }, ]; const actionBtn = 'flex items-center gap-1 px-2.5 py-1 text-xs glass rounded-md border border-border/30 text-muted-foreground hover:text-primary hover:border-primary/30 hover:bg-primary/10 transition-all disabled:opacity-40 disabled:cursor-not-allowed'; 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

)}
); }