"use client"; import { RefreshCw } from "lucide-react"; import { Card, CardContent } from "@/components/ui/card"; import { useEffect, useState } from "react"; interface Quote { quote: string; author: string; } export function QuoteCard() { const fetchQuote = async (): Promise => { // Récupere la liste des citations depuis le fichier dans /public/quotes.json const response = await fetch("/quotes.json"); const data = await response.json(); // Retourne une citation aléatoire return data[Math.floor(Math.random() * data.length)]; }; const [quote, setQuote] = useState(null); useEffect(() => { fetchQuote().then(setQuote); }, []); const handleRefresh = () => { fetchQuote().then(setQuote); }; return (

{quote ? quote.quote : "Loading..."}

{quote ? quote.author : "Loading..."}
); }