import { useState } from "react"; import { StyleSheet, View, ActivityIndicator } from "react-native"; import { Text } from "@/components/ui/Text"; import { ScreenLayout } from "@/components/ui/ScreenLayout"; import { useAuth } from "@/context/AuthContext"; import { Col, Between } from "@/components/ui/LayoutHelpers"; import { Card } from "@/components/ui/Cards"; import { Button } from "@/components/ui/Button"; import { Section, SectionHeader } from "@/components/ui/Sections"; import { MoodSelector } from "@/components/ui/EmojiSelectors"; import { Typography, Shadows, Colors, BorderRadius, } from "@/constants/theme"; import { router } from "expo-router"; import { MOODS } from "@/constants/moods"; import { useMoodEntries } from "@/hooks"; import MoodEntryLog from "@/components/ui/MoodEntryLog"; import { DailyEnergyWidget } from "@/components/ui/DailyEnergyWidget"; import { DailySleepWidget } from "@/components/ui/DailySleepWidget"; import { EmptyState } from "@/components/ui/EmptyState"; export default function New() { const { user } = useAuth(); const [mood, setMood] = useState("good"); const { data, isLoading } = useMoodEntries({ limit: 5 }); const recentEntries = data?.entries ?? []; const initQuickRegister = () => { // TODO: Set down on camelCase vs kebab case router.navigate(`/new/entry?initialMood=${mood}`); }; return (
Registro rápido HOJE
{/* TODO: Check whether we gonna have to generate these on demand */}
{isLoading ? ( ) : recentEntries.length === 0 ? ( ) : ( {recentEntries.map((entry) => ( ))} )}
); } const styles = StyleSheet.create({ quickRegisterHeader: { marginTop: 16, paddingLeft: 16, paddingRight: 16, }, quickRegisterTitle: { ...Typography.bodyLg, }, // TODO: Replace when we have badges quickRegisterBadge: { fontSize: 12, lineHeight: 16, }, quickRegisterButton: { marginLeft: 16, marginRight: 16, marginBottom: 16, ...Shadows.lg, }, lineTrack: { height: 6, backgroundColor: Colors.light.divider, borderRadius: BorderRadius.full, marginBottom: 4, overflow: "hidden", }, lineFill: { height: "100%", backgroundColor: Colors.light.tint, borderRadius: BorderRadius.full, }, indicatorGreen: { color: Colors.light.tint, fontSize: 11, fontWeight: 600, lineHeight: 16.5, }, });