aboutsummaryrefslogtreecommitdiff
path: root/desktop/src/components/SessionDots.tsx
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-06-13 17:12:24 +0530
committerRanXom <saiyedshizain@gmail.com>2026-06-13 17:12:24 +0530
commitcc27f9d8d97b9fedd6edfbe9985104f5c3999e07 (patch)
tree92abbf4b47a3262094d43cb1bc36660ec7945ea0 /desktop/src/components/SessionDots.tsx
parente3581344f734e0a61553863905e9d170dfb8eacf (diff)
downloadpomoru-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.tsx32
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>
+ );
+}