'use client';
import { useState, useEffect } from 'react';
import { Clock, Timer, Bell, ChevronRight, X } from 'lucide-react';
const ONBOARDING_KEY = 'cm-onboarding-complete';
interface OnboardingStep {
title: string;
description: string;
icon: React.ReactNode;
hint: string;
}
const STEPS: OnboardingStep[] = [
{
title: 'Create a Timer',
description: 'Tap "New Timer" or press N to create your first timer. Try natural language like "meeting in 30 min".',
icon: ,
hint: 'Timers can be alarms, countdowns, Pomodoro sessions, or event countdowns.',
},
{
title: 'Set Pre-Warning Cascades',
description: 'Choose how early you want reminders — Aggressive gives you many warnings, Light just a few gentle nudges.',
icon: ,
hint: 'Cascades are what make ChronoMind unique. Never be caught off-guard again.',
},
{
title: 'Watch Your Timeline',
description: 'Active timers appear here sorted by fire time. Each card shows countdown, cascade progress, and urgency level.',
icon: ,
hint: 'Try Focus mode (eye icon) for distraction-free sessions, or Routines for multi-step workflows.',
},
];
export function OnboardingOverlay() {
const [step, setStep] = useState(0);
const [visible, setVisible] = useState(false);
useEffect(() => {
if (typeof window === 'undefined') return;
const done = localStorage.getItem(ONBOARDING_KEY);
if (!done) setVisible(true);
}, []);
const dismiss = () => {
setVisible(false);
localStorage.setItem(ONBOARDING_KEY, 'true');
};
const next = () => {
if (step < STEPS.length - 1) {
setStep(step + 1);
} else {
dismiss();
}
};
if (!visible) return null;
const current = STEPS[step];
return (
{/* Backdrop */}
{/* Card */}
{/* Close */}
{/* Step indicator */}
{STEPS.map((_, i) => (
))}
{/* Content */}
{current.icon}
{current.title}
{current.description}
{current.hint}
{/* Actions */}
{step > 0 && (
)}
{/* Skip link */}
);
}