import { useState } from 'react'; import { ScrollView, View, Text } from 'react-native' import { ScreenLayout } from '@/components/ui/ScreenLayout'; import { Section, SectionHeader } from '@/components/ui/Sections'; import { FilterPills } from '@/components/ui/FilterPills'; import { useAuth } from '@/context/AuthContext'; import { useHistoryFeed } from '@/hooks/useHistoryFeed'; import type { HistoryCategory } from '@/lib/history/types'; import { MoodHistoryCard } from '@/components/history/MoodHistoryCard' import { SleepRecordCard } from '@/components/history/SleepRecordCard' const FILTERS: { label: string; value: HistoryCategory | 'all' }[] = [ { label: 'Tudo', value: 'all' }, { label: 'Humor', value: 'mood' }, { label: 'Sono', value: 'sleep' } ]; function HistoryCardRenderer({ card }: { card: HistoryCard }) { switch (card.category) { case 'mood': return case 'sleep': return } } export default function History() { const { user } = useAuth(); const [activeFilter, setActiveFilter] = useState('all'); const grouped = useHistoryFeed(activeFilter); return ( console.log('Notifications')} showNotificationBadge={true}> {Object.entries(grouped).map(([date, cards]) => (
{cards.map(card => ( ) )}
))}
); }