eletrotupi / tcc/ frontend/components/insights/WeeklyResume.tsx507c97f5ff722b353a218e5ce11526754af998a2
1.9 KB | 87 lines Raw
1
import React from "react";
2
import { View, Text, StyleSheet } from "react-native";
3
import { Colors, Typography, Spacing, BorderRadius } from "@/constants/theme";
4

5
interface WeeklyResumeProps {
6
  avgMood: string;
7
  stats: { label: string; value: string }[];
8
}
9

10
export const WeeklyResume: React.FC<WeeklyResumeProps> = ({
11
  avgMood,
12
  stats,
13
}) => {
14
  return (
15
    <View style={styles.heroCard}>
16
      <Text style={styles.heroLabel}>Resumo Semanal</Text>
17

18
      <View style={styles.heroScoreRow}>
19
        <Text style={styles.heroScore}>{avgMood}</Text>
20
      </View>
21

22
      <View style={styles.heroDivider} />
23

24
      <View style={styles.heroStats}>
25
        {stats.map((stat) => (
26
          <View key={stat.label} style={styles.heroStatItem}>
27
            <Text style={styles.heroStatLabel}>{stat.label}</Text>
28
            <Text style={styles.heroStatValue}>{stat.value}</Text>
29
          </View>
30
        ))}
31
      </View>
32
    </View>
33
  );
34
};
35

36
const styles = StyleSheet.create({
37
  heroCard: {
38
    backgroundColor: Colors.light.black,
39
    borderRadius: BorderRadius.lg,
40
    padding: 20,
41
    marginBottom: Spacing.sectionGap,
42
  },
43
  heroLabel: {
44
    fontSize: 11,
45
    fontWeight: "600",
46
    letterSpacing: 0.8,
47
    textTransform: "uppercase",
48
    color: Colors.light.tint,
49
    marginBottom: 8,
50
  },
51
  heroScoreRow: {
52
    flexDirection: "row",
53
    alignItems: "center",
54
    gap: 10,
55
  },
56
  heroScore: {
57
    ...Typography.headlineXg,
58
    fontSize: 52,
59
    color: "#ffffff",
60
  },
61
  heroTrendIcon: {
62
    marginTop: 6,
63
  },
64
  heroDivider: {
65
    height: StyleSheet.hairlineWidth,
66
    backgroundColor: "rgba(255,255,255,0.12)",
67
    marginVertical: 16,
68
  },
69
  heroStats: {
70
    flexDirection: "row",
71
    gap: Spacing.sectionGap,
72
  },
73
  heroStatItem: {
74
    flex: 1,
75
  },
76
  heroStatLabel: {
77
    fontSize: 12,
78
    color: "rgba(255,255,255,0.45)",
79
    fontWeight: "500",
80
    marginBottom: 4,
81
  },
82
  heroStatValue: {
83
    ...Typography.bodyLg,
84
    fontSize: 20,
85
    color: "#ffffff",
86
  },
87
});