diff --git a/app/src/components/ui/dialogs.tsx b/app/src/components/ui/dialogs.tsx index 6f469e0..4eea134 100644 --- a/app/src/components/ui/dialogs.tsx +++ b/app/src/components/ui/dialogs.tsx @@ -235,6 +235,11 @@ export type SetFieldValues = { reps: string; rir: string; difficulty: string }; export type PlannedValues = { reps: number | null; rir: number | null; difficulty: number | null }; +/* Trwająca przerwa pokazana w oknie serii (timer + informacja, że zapis zrestartuje odliczanie). */ +export type SetEditRestInfo = { remaining: number; total: number; resetsOnSave: boolean }; + +const fmtRestSec = (sec: number) => `${Math.floor(sec / 60)}:${String(sec % 60).padStart(2, '0')}`; + /* Bulk set editor — fill in all set fields at once (each via the number pad). */ export function SetEditDialog({ open, @@ -242,6 +247,7 @@ export function SetEditDialog({ values, planned, title, + rest, onSave, onClose, }: { @@ -251,6 +257,8 @@ export function SetEditDialog({ planned: PlannedValues; /** Tytuł okna — domyślnie „Uzupełnij serię N” (przekazuj „Edytuj serię N” dla uzupełnionych serii). */ title?: string; + /** Trwająca przerwa — timer odświeżany co sekundę przez rodzica. */ + rest?: SetEditRestInfo | null; onSave: (values: SetFieldValues) => void; onClose: () => void; }) { @@ -274,6 +282,23 @@ export function SetEditDialog({ return ( <> + {rest && rest.remaining > 0 && ( +
+
+
+ {rest.resetsOnSave && ( +

+ Zapisanie serii zrestartuje odliczanie przerwy. +

+ )} +
+ )} {hasNorm && (