import { useState } from "react";
import { ScrollView, View } 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 { HistoryCard, HistoryCategory } from "@/lib/history/types";
import { MoodHistoryCard } from "@/components/history/MoodHistoryCard";
import { SleepRecordCard } from "@/components/history/SleepRecordCard";
import { TriggerHistoryCard } from "@/components/history/TriggerCard";
import { MedicineHistoryCard } from "@/components/history/MedicineHistoryCard";
import { AppointmentHistoryCard } from "@/components/history/AppointmentHistoryCard";
import { ActivityHistoryCard } from "@/components/history/ActivityHistoryCard";
import { EmptyState } from "@/components/ui/EmptyState";
function HistoryCardRenderer({ card }: { card: HistoryCard }) {
switch (card.category) {
case "mood":
return ;
case "sleep":
return ;
case "trigger":
return ;
case "care_action":
switch (card.subtype) {
case "medicine":
return ;
case "appointment":
return ;
case "activity":
return ;
default:
return null;
}
}
}
export default function History() {
const { user } = useAuth();
const [activeFilter, setActiveFilter] = useState(
"all",
);
const grouped = useHistoryFeed(activeFilter);
return (
{Object.keys(grouped).length === 0 ? (
) : (
Object.entries(grouped).map(([date, cards]) => (
{cards.map((card) => (
))}
))
)}
);
}