diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-06-13 17:12:24 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-06-13 17:12:24 +0530 |
| commit | cc27f9d8d97b9fedd6edfbe9985104f5c3999e07 (patch) | |
| tree | 92abbf4b47a3262094d43cb1bc36660ec7945ea0 /desktop/src/components/SessionDots.tsx | |
| parent | e3581344f734e0a61553863905e9d170dfb8eacf (diff) | |
| download | pomoru-cc27f9d8d97b9fedd6edfbe9985104f5c3999e07.tar.xz pomoru-cc27f9d8d97b9fedd6edfbe9985104f5c3999e07.zip | |
introduce Header, Session and Titlebar components
Diffstat (limited to 'desktop/src/components/SessionDots.tsx')
| -rw-r--r-- | desktop/src/components/SessionDots.tsx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/desktop/src/components/SessionDots.tsx b/desktop/src/components/SessionDots.tsx new file mode 100644 index 0000000..de96f3c --- /dev/null +++ b/desktop/src/components/SessionDots.tsx @@ -0,0 +1,32 @@ +import type { TimerState } from "../lib/commands"; + +interface SessionDotsProps { + timer: TimerState; + onCycleMode: () => void; +} + +const modes: Array<{ key: string; label: string }> = [ + { key: "work", label: "Focus" }, + { key: "short-break", label: "Short Break" }, + { key: "long-break", label: "Long Break" }, +]; + +export default function SessionDots({ timer, onCycleMode }: SessionDotsProps) { + return ( + <div className="session-dots" id="session-dots"> + {modes.map((m) => ( + <button + key={m.key} + className={`session-dot ${timer.mode === m.key ? "active" : ""}`} + onClick={onCycleMode} + disabled={timer.is_running} + aria-label={`Switch to ${m.label}`} + title={timer.is_running ? "Pause to switch" : `Switch to ${m.label}`} + > + {timer.mode === m.key && <span className="dot-indicator" />} + {m.label} + </button> + ))} + </div> + ); +} |