Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion app/components/LandingPageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -952,7 +969,12 @@ export default function LandingPageClient() {
defaultValue: 'Download SVG',
})}
</button>

<button
onClick={handleCopySvg}
className="px-4 py-2 rounded-lg bg-purple-600 text-sm font-medium text-white hover:bg-purple-800 transition-colors"
>
Copy SVG
</button>
<button
onClick={DownloadPDF}
className="px-4 py-2 rounded-lg bg-emerald-600 text-sm font-medium text-white hover:bg-emerald-800 transition-colors"
Expand Down
Loading