import React, { useState } from 'react'; import { View, StyleSheet } from 'react-native'; import { router } from 'expo-router'; import { SafeAreaView } from 'react-native-safe-area-context'; import { Text } from '@/components/ui/Text'; import { Button } from '@/components/ui'; import { useAuth } from '@/context/AuthContext'; import { useThemeColor } from '@/hooks/use-theme-color'; const PAGES = [ { title: 'Bem vindo ao nexo', body: 'Registre seu humor ao longo do dia, sempre depois que aconteceu. É um diário, não uma cobrança.', }, { title: 'No seu ritmo', body: 'Anote quantos momentos quiser. Cada registro guarda o humor, a intensidade e o que aconteceu.', }, { title: 'Olhe para trás', body: 'Com o tempo, o Histórico e a Jornada mostram padrões entre humor, sono, gatilhos e ações de cuidado.', }, ]; export default function OnboardingScreen() { const [index, setIndex] = useState(0); const [saving, setSaving] = useState(false); const { completeOnboarding } = useAuth(); const textColor = useThemeColor({}, 'text'); const backgroundColor = useThemeColor({}, 'background'); const tintColor = useThemeColor({}, 'tint'); const page = PAGES[index]; const isLast = index === PAGES.length - 1; const finish = async () => { if (saving) return; setSaving(true); try { await completeOnboarding(); } catch (error) { console.error('Failed to complete onboarding:', error); } finally { setSaving(false); router.replace('/(tabs)/new'); } }; return ( {page.title} {page.body} {PAGES.map((_, i) => ( ))}