diff --git a/web/src/components/ReaderView.tsx b/web/src/components/ReaderView.tsx index 0e72bb7..1100264 100644 --- a/web/src/components/ReaderView.tsx +++ b/web/src/components/ReaderView.tsx @@ -1,6 +1,5 @@ -import { ReaderViewProps } from './ReaderView'; // Self-reference import seems wrong, removing. +import { useState } from 'react'; import { ShareButton } from './ShareButton'; -// No need to import ReaderViewProps if we define it here, but let's keep clean. import { type Article, articlesApi } from '../api/articles'; interface ReaderViewProps { diff --git a/web/src/components/ShareButton.tsx b/web/src/components/ShareButton.tsx index d779ec5..655ad97 100644 --- a/web/src/components/ShareButton.tsx +++ b/web/src/components/ShareButton.tsx @@ -35,7 +35,7 @@ export function ShareButton({ article, className = "" }: ShareButtonProps) { }; const copyToClipboard = () => { - navigator.clipboard.writeText(article.url); + navigator.clipboard.writeText(article.url || window.location.href); setCopied(true); setTimeout(() => setCopied(false), 2000); setIsOpen(false);