diff --git a/components/color/ExportMenu.tsx b/components/color/ExportMenu.tsx index cbf44d5..9522452 100644 --- a/components/color/ExportMenu.tsx +++ b/components/color/ExportMenu.tsx @@ -1,7 +1,7 @@ 'use client'; import { useState, useEffect } from 'react'; -import { Download, Copy, Check, Loader2 } from 'lucide-react'; +import { Download, Loader2 } from 'lucide-react'; import { toast } from 'sonner'; import { exportAsCSS, @@ -13,6 +13,7 @@ import { type ExportColor, } from '@/lib/color/utils/export'; import { colorAPI } from '@/lib/color/api/client'; +import { CodeSnippet } from '@/components/ui/code-snippet'; import { cn } from '@/lib/utils/cn'; interface ExportMenuProps { @@ -34,7 +35,6 @@ export function ExportMenu({ colors, className }: ExportMenuProps) { const [colorSpace, setColorSpace] = useState('hex'); const [convertedColors, setConvertedColors] = useState(colors); const [isConverting, setIsConverting] = useState(false); - const [copied, setCopied] = useState(false); useEffect(() => { async function convertColors() { @@ -68,13 +68,6 @@ export function ExportMenu({ colors, className }: ExportMenuProps) { const getExt = () => ({ css: 'css', scss: 'scss', tailwind: 'js', json: 'json', javascript: 'js' }[format]); - const handleCopy = () => { - navigator.clipboard.writeText(getContent()); - setCopied(true); - toast.success('Copied!'); - setTimeout(() => setCopied(false), 2000); - }; - const handleDownload = () => { downloadAsFile(getContent(), `palette.${getExt()}`, 'text/plain'); toast.success('Downloaded!'); @@ -111,31 +104,20 @@ export function ExportMenu({ colors, className }: ExportMenuProps) { {/* Code preview */} -
+
{isConverting && ( -
+
)} -
-          {getContent()}
-        
+
{/* Actions */} -
- - -
+
); }