diff --git a/src/app/daily-quote/page.jsx b/src/app/daily-quote/page.jsx index a7c46f7..0e78b57 100644 --- a/src/app/daily-quote/page.jsx +++ b/src/app/daily-quote/page.jsx @@ -8,6 +8,7 @@ export default function DailyQuote() { const [quote, setQuote] = useState("Loading..."); const [author, setAuthor] = useState("Anonymous"); const [error, setError] = useState(); + const [copied, setCopied] = useState(false); useEffect(() => { async function fetchData() { @@ -24,6 +25,8 @@ export default function DailyQuote() { }, []); const getNewQuote = async () => { + setQuote("Loading..."); + setCopied(false); const response = await axios.get("/api/quote"); setQuote(response.data[0].q); setAuthor(response.data[0].a); @@ -31,6 +34,7 @@ export default function DailyQuote() { const copyQuote = async () => { await navigator.clipboard.writeText(`${quote} - ${author}`); + setCopied(true); }; return ( @@ -68,6 +72,7 @@ export default function DailyQuote() { Copy + {copied &&

Copied successfully!

}