diff --git a/frontend/src/components/modals/ExportModal.tsx b/frontend/src/components/modals/ExportModal.tsx index b1e3a9b..dcced61 100644 --- a/frontend/src/components/modals/ExportModal.tsx +++ b/frontend/src/components/modals/ExportModal.tsx @@ -2,7 +2,15 @@ import { useState } from 'react' import { Download, Loader2 } from 'lucide-react' import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog' import { Button } from '@/components/ui/button' -import { exportToPng, exportToSvg, EXPORT_QUALITY_OPTIONS, type ExportQuality, type ExportFormat } from '@/utils/export' +import { + exportToPng, + exportToSvg, + EXPORT_QUALITY_OPTIONS, + EXPORT_BACKGROUND_OPTIONS, + type ExportQuality, + type ExportFormat, + type ExportBackground, +} from '@/utils/export' interface ExportModalProps { open: boolean @@ -13,6 +21,7 @@ interface ExportModalProps { export function ExportModal({ open, onClose, getElement }: ExportModalProps) { const [quality, setQuality] = useState('high') const [format, setFormat] = useState('png') + const [background, setBackground] = useState('dark') const [exporting, setExporting] = useState(false) const handleExport = async () => { @@ -21,9 +30,9 @@ export function ExportModal({ open, onClose, getElement }: ExportModalProps) { setExporting(true) try { if (format === 'svg') { - await exportToSvg(el) + await exportToSvg(el, background) } else { - await exportToPng(el, quality) + await exportToPng(el, quality, background) } onClose() } finally { @@ -70,6 +79,32 @@ export function ExportModal({ open, onClose, getElement }: ExportModalProps) { +
+

Background

+
+ {EXPORT_BACKGROUND_OPTIONS.map((opt) => ( + + ))} +
+
+