| 1 | import { View, ScrollView, StyleSheet } from "react-native";
|
| 2 |
|
| 3 | import { ThemedView } from "@/components/misc/themed-view";
|
| 4 | import { ScreenLayout } from "@/components/ui/ScreenLayout";
|
| 5 | import { useAuth } from "@/context/AuthContext";
|
| 6 | import { Card } from "@/components/ui/Cards";
|
| 7 | import { Section, SectionHeader } from "@/components/ui/Sections";
|
| 8 | import { useThemeColor } from "@/hooks/use-theme-color";
|
| 9 | import { Spacing, BorderRadius, Colors, Typography } from "@/constants/theme";
|
| 10 | import { WeeklyResume } from "@/components/insights/WeeklyResume";
|
| 11 | import { InsightCard, Highlight } from "@/components/insights/InsightCard";
|
| 12 | import { MoodTrendWidget } from "@/components/insights/MoodTrendWidget";
|
| 13 | import { EnergySleepWidget } from "@/components/insights/EnergySleepWidget";
|
| 14 | import { TriggerPatternWidget } from "@/components/insights/TriggerPatternWidget";
|
| 15 |
|
| 16 | export default function Insights() {
|
| 17 | const { user } = useAuth();
|
| 18 |
|
| 19 | return (
|
| 20 | <ScreenLayout
|
| 21 | userName={user?.firstName}
|
| 22 | userAvatar={user?.avatarURL}
|
| 23 | showNotificationBadge={true}
|
| 24 | >
|
| 25 | <WeeklyResume
|
| 26 | avgMood="Neutro"
|
| 27 | stats={[
|
| 28 | { label: "Média de Sono", value: "7.2h" },
|
| 29 | { label: "Humor Estável", value: "92%" },
|
| 30 | ]}
|
| 31 | />
|
| 32 |
|
| 33 | <Section>
|
| 34 | <SectionHeader title="Indicadores" subtitle="Baseado nos últimos 7 dias" />
|
| 35 |
|
| 36 | <EnergySleepWidget />
|
| 37 |
|
| 38 | <MoodTrendWidget />
|
| 39 |
|
| 40 | <TriggerPatternWidget />
|
| 41 | </Section>
|
| 42 | </ScreenLayout>
|
| 43 | );
|
| 44 | }
|
| 45 |
|
| 46 | const styles = StyleSheet.create({
|
| 47 | scrollView: {
|
| 48 | flex: 1,
|
| 49 | backgroundColor: Colors.light.background,
|
| 50 | },
|
| 51 | contentContainer: {
|
| 52 | padding: Spacing.containerPadding,
|
| 53 | paddingBottom: 40,
|
| 54 | },
|
| 55 |
|
| 56 | // Hero card
|
| 57 | heroCard: {
|
| 58 | backgroundColor: Colors.light.textBlack,
|
| 59 | borderRadius: BorderRadius.lg,
|
| 60 | padding: 20,
|
| 61 | marginBottom: Spacing.sectionGap,
|
| 62 | },
|
| 63 | heroLabel: {
|
| 64 | fontSize: 11,
|
| 65 | fontWeight: "600",
|
| 66 | letterSpacing: 0.8,
|
| 67 | textTransform: "uppercase",
|
| 68 | color: Colors.light.tint,
|
| 69 | marginBottom: 8,
|
| 70 | },
|
| 71 | heroScoreRow: {
|
| 72 | flexDirection: "row",
|
| 73 | alignItems: "center",
|
| 74 | gap: 10,
|
| 75 | },
|
| 76 | heroScore: {
|
| 77 | ...Typography.headlineXg,
|
| 78 | fontSize: 52,
|
| 79 | color: "#ffffff",
|
| 80 | },
|
| 81 | heroTrendIcon: {
|
| 82 | marginTop: 6,
|
| 83 | },
|
| 84 | heroDivider: {
|
| 85 | height: StyleSheet.hairlineWidth,
|
| 86 | backgroundColor: "rgba(255,255,255,0.12)",
|
| 87 | marginVertical: 16,
|
| 88 | },
|
| 89 | heroStats: {
|
| 90 | flexDirection: "row",
|
| 91 | gap: Spacing.sectionGap,
|
| 92 | },
|
| 93 | heroStatItem: {
|
| 94 | flex: 1,
|
| 95 | },
|
| 96 | heroStatLabel: {
|
| 97 | fontSize: 12,
|
| 98 | color: "rgba(255,255,255,0.45)",
|
| 99 | fontWeight: "500",
|
| 100 | marginBottom: 4,
|
| 101 | },
|
| 102 | heroStatValue: {
|
| 103 | ...Typography.bodyLg,
|
| 104 | fontSize: 20,
|
| 105 | color: "#ffffff",
|
| 106 | },
|
| 107 |
|
| 108 | // Insight cards
|
| 109 | insightCardInner: {
|
| 110 | flexDirection: "row",
|
| 111 | alignItems: "center",
|
| 112 | justifyContent: "space-between",
|
| 113 | gap: 12,
|
| 114 | },
|
| 115 | insightCardLeft: {
|
| 116 | flex: 1,
|
| 117 | gap: 6,
|
| 118 | },
|
| 119 | insightCategory: {
|
| 120 | fontSize: 11,
|
| 121 | fontWeight: "600",
|
| 122 | letterSpacing: 0.8,
|
| 123 | textTransform: "uppercase",
|
| 124 | color: Colors.light.textSecondary,
|
| 125 | },
|
| 126 | insightBody: {
|
| 127 | ...Typography.bodyMd,
|
| 128 | color: Colors.light.text,
|
| 129 | },
|
| 130 | insightMetric: {
|
| 131 | ...Typography.headlineLg,
|
| 132 | fontSize: 22,
|
| 133 | },
|
| 134 | });
|