Add synthesis refresh countdown display
Show a live countdown (15→0s) in the synthesis header indicating when the next auto-refresh will occur. Resets on every successful synthesis fetch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,14 @@ export default function Home() {
|
||||
query: { refetchInterval: 15000 },
|
||||
});
|
||||
|
||||
const [countdown, setCountdown] = React.useState(15);
|
||||
React.useEffect(() => { setCountdown(15); }, [synthesis]);
|
||||
React.useEffect(() => {
|
||||
if (countdown <= 0) return;
|
||||
const t = setTimeout(() => setCountdown(c => c - 1), 1000);
|
||||
return () => clearTimeout(t);
|
||||
}, [countdown]);
|
||||
|
||||
// Soumission effective après confirmation du consentement (ou si déjà consenti)
|
||||
const doActualSubmit = (data: SubmitIdeaValues) => {
|
||||
if (captchaToken) {
|
||||
@@ -544,7 +552,7 @@ export default function Home() {
|
||||
<Users className="h-3.5 w-3.5" /> Synthèse des contributions
|
||||
</h2>
|
||||
<p className="text-xs text-muted-foreground mt-0.5">
|
||||
Mise à jour à chaque nouvelle contribution
|
||||
Mise à jour à chaque nouvelle contribution · <span className="font-mono">{countdown}s</span>
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 flex-shrink-0">
|
||||
|
||||
Reference in New Issue
Block a user