mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
- Sauvegarder l'état du timer (mode, temps restant, état running, sessions) dans localStorage - Restaurer l'état au montage du composant - Le timer ne se réinitialise plus quand le modal se ferme et se rouvre - Simplifier le PomodoroModal pour utiliser children directement
29 lines
703 B
TypeScript
29 lines
703 B
TypeScript
import { ReactNode } from "react";
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from "@/components/ui/dialog";
|
|
|
|
interface PomodoroModalProps {
|
|
open: boolean;
|
|
onOpenChange: (open: boolean) => void;
|
|
children: ReactNode;
|
|
}
|
|
|
|
export function PomodoroModal({ open, onOpenChange, children }: PomodoroModalProps) {
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
<DialogContent className="max-w-md">
|
|
<DialogHeader>
|
|
<DialogTitle className="text-2xl">Pomodoro Timer</DialogTitle>
|
|
</DialogHeader>
|
|
<div className="mt-4">
|
|
{children}
|
|
</div>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|