@@ -16,6 +16,30 @@ interface BreakProgressProps {
16
16
sharedBreakEndTime ?: number | null ;
17
17
}
18
18
19
+ function TimeDisplay ( {
20
+ seconds,
21
+ textColor,
22
+ } : {
23
+ seconds : number ;
24
+ textColor : string ;
25
+ } ) {
26
+ const minutes = Math . floor ( seconds / 60 ) ;
27
+ const remainingSeconds = seconds % 60 ;
28
+
29
+ return (
30
+ < div
31
+ className = "text-sm font-medium opacity-60 flex-shrink-0 tabular-nums flex items-center gap-0.5"
32
+ style = { { color : textColor } }
33
+ >
34
+ < span style = { { color : textColor } } > { minutes } </ span >
35
+ < span style = { { color : textColor } } > :</ span >
36
+ < span style = { { color : textColor } } >
37
+ { String ( remainingSeconds ) . padStart ( 2 , "0" ) }
38
+ </ span >
39
+ </ div >
40
+ ) ;
41
+ }
42
+
19
43
export function BreakProgress ( {
20
44
breakMessage,
21
45
breakTitle,
@@ -126,6 +150,12 @@ export function BreakProgress({
126
150
127
151
const progressPercentage = ( progress || 0 ) * 100 ;
128
152
153
+ const elapsedSeconds =
154
+ settings . breakLengthSeconds -
155
+ ( timeRemaining ?. hours || 0 ) * 3600 -
156
+ ( timeRemaining ?. minutes || 0 ) * 60 -
157
+ Math . floor ( timeRemaining ?. seconds || 0 ) ;
158
+
129
159
return (
130
160
< motion . div
131
161
className = "flex flex-col h-full w-full z-10 relative space-y-6"
@@ -162,8 +192,14 @@ export function BreakProgress({
162
192
{ breakMessage }
163
193
</ div >
164
194
165
- { /* Progress bar */ }
166
- < div className = "w-full mt-3" >
195
+ < div className = "w-full" >
196
+ < div className = "flex justify-between items-center mb-2" >
197
+ < TimeDisplay seconds = { elapsedSeconds } textColor = { textColor } />
198
+ < TimeDisplay
199
+ seconds = { settings . breakLengthSeconds }
200
+ textColor = { textColor }
201
+ />
202
+ </ div >
167
203
< div
168
204
className = "w-full h-2 rounded-full overflow-hidden"
169
205
style = { { backgroundColor : "rgba(255, 255, 255, 0.2)" } }
0 commit comments