From 980597348b82533ec5acb36412bb272a6e1e797b Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 27 May 2025 17:33:28 +0200 Subject: [PATCH] Update rss-link.tsx --- web/components/rss-link.tsx | 62 ++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/web/components/rss-link.tsx b/web/components/rss-link.tsx index 16b49ac..137cdcd 100644 --- a/web/components/rss-link.tsx +++ b/web/components/rss-link.tsx @@ -1,22 +1,56 @@ -import { Rss } from "lucide-react" +"use client" + +import { Rss, Copy, Check } from "lucide-react" import Link from "next/link" +import { useState } from "react" export default function RSSLink() { + const [copied, setCopied] = useState(false) + const rssUrl = `${typeof window !== "undefined" ? window.location.origin : ""}/api/rss` + + const copyToClipboard = async () => { + try { + await navigator.clipboard.writeText(rssUrl) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } catch (err) { + console.error("Failed to copy: ", err) + } + } + return ( -
-
-

Stay Updated!

-

Subscribe to our RSS feed to get notified of new changes.

+
+
+
+

Stay Updated!

+

+ Subscribe to our RSS feed to get notified of new changes. Copy the URL below or click the RSS button. +

+ +
+ {rssUrl} + +
+
+ + + + RSS +
- - - RSS Feed -
) }