'use client'; import { useEffect, useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; /** * Onboarding persistence key. * If you later want this to come from env/config, move it to apps/web/config/onboarding.ts */ const STORAGE_KEY = 'horux360:onboarding_seen_v1'; export default function OnboardingScreen() { const router = useRouter(); const [isNewUser, setIsNewUser] = useState(true); const [loading, setLoading] = useState(false); const safePush = (path: string) => { // Avoid multiple navigations if user clicks quickly. if (loading) return; setLoading(true); router.push(path); }; useEffect(() => { const seen = typeof window !== 'undefined' && localStorage.getItem(STORAGE_KEY) === '1'; // If the user has already seen onboarding, go to dashboard automatically. if (seen) { setIsNewUser(false); setLoading(true); const t = setTimeout(() => router.push('/dashboard'), 900); return () => clearTimeout(t); } }, [router]); const handleContinue = () => { if (typeof window !== 'undefined') localStorage.setItem(STORAGE_KEY, '1'); setLoading(true); setTimeout(() => router.push('/dashboard'), 700); }; const handleReset = () => { if (typeof window !== 'undefined') localStorage.removeItem(STORAGE_KEY); location.reload(); }; const headerStatus = useMemo(() => (isNewUser ? 'Onboarding' : 'Redirección'), [isNewUser]); return (
{/* Grid tech claro */}
{/* Glow global azul (sutil) */}
{/* Header */}

Horux360

Pantalla de inicio

{headerStatus}
{/* Body */}
{isNewUser ? (
{/* Left */}

Bienvenido a Horux360

Revisa este breve video para conocer el flujo. Después podrás continuar.

Usuario nuevo: muestra video • Usuario recurrente: redirección automática
{/* Right (video) - elegante sin glow */}
Video introductorio v1
) : (

Redirigiendo al dashboard…

Usuario recurrente detectado.

)}

Demo UI sin backend • Persistencia local: localStorage

); }