diff --git a/app/components/LandingPageClient.tsx b/app/components/LandingPageClient.tsx index f3eccee87..28d9dc9f3 100644 --- a/app/components/LandingPageClient.tsx +++ b/app/components/LandingPageClient.tsx @@ -385,7 +385,24 @@ export default function LandingPageClient() { link.click(); document.body.removeChild(link); }; + const handleCopySvg = async () => { + try { + const response = await fetch(badgeUrl); + + if (!response.ok) { + throw new Error('Failed to fetch SVG'); + } + + const svgText = await response.text(); + await navigator.clipboard.writeText(svgText); + + alert('SVG copied to clipboard!'); + } catch (err) { + console.error(err); + alert('Failed to copy SVG.'); + } + }; const DownloadPDF = async () => { try { const response = await fetch(badgeUrl); @@ -952,7 +969,12 @@ export default function LandingPageClient() { defaultValue: 'Download SVG', })} - +