| // src/components/flow/FocusModeOverlay.tsx | |
| import { useFocusMode } from "@/hooks/useFocusMode"; | |
| import { Shield, Zap, Clock, Brain, Eye } from "lucide-react"; | |
| import { motion, AnimatePresence } from "framer-motion"; | |
| export function FocusModeOverlay() { | |
| const { focusState, isFocusMode, deepWorkStreakMinutes, interruptionsBlocked, toggleFocusMode } = useFocusMode(); | |
| if (!isFocusMode) return null; | |
| const formatStreak = (mins: number) => { | |
| if (mins < 60) return `${mins}m`; | |
| const h = Math.floor(mins / 60); | |
| const m = mins % 60; | |
| return `${h}h ${m}m`; | |
| }; | |
| return ( | |
| <AnimatePresence> | |
| <motion.div | |
| initial={{ opacity: 0, y: -20 }} | |
| animate={{ opacity: 1, y: 0 }} | |
| exit={{ opacity: 0, y: -20 }} | |
| className="fixed top-4 left-1/2 -translate-x-1/2 z-[80] glass rounded-2xl px-5 py-3 flex items-center gap-4 shadow-xl" | |
| > | |
| <div className="flex items-center gap-2"> | |
| <div className="w-2.5 h-2.5 rounded-full bg-red-500 animate-pulse" /> | |
| <span className="text-sm font-semibold text-red-600 dark:text-red-400"> | |
| Focus Mode Active | |
| </span> | |
| </div> | |
| <div className="flex items-center gap-3 text-xs text-gray-500"> | |
| <span className="flex items-center gap-1"> | |
| <Clock className="w-3.5 h-3.5" /> {formatStreak(deepWorkStreakMinutes)} | |
| </span> | |
| <span className="flex items-center gap-1"> | |
| <Shield className="w-3.5 h-3.5" /> {interruptionsBlocked} blocked | |
| </span> | |
| </div> | |
| <button | |
| onClick={toggleFocusMode} | |
| className="text-xs px-3 py-1 bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 rounded-full hover:bg-red-200 transition" | |
| > | |
| End Focus | |
| </button> | |
| </motion.div> | |
| </AnimatePresence> | |
| ); | |
| } |
Xet Storage Details
- Size:
- 1.84 kB
- Xet hash:
- 2ee79d5d91cdd24fbe9dad8fcb1098360dd2d9568c1519972bbc82b363dba0ee
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.