import { View, Text, StyleSheet, KeyboardAvoidingView, ScrollView, TouchableOpacity, } from "react-native"; import { useState } from "react"; import { router } from "expo-router"; import { Card } from "@/components/ui/Cards"; import { TextArea } from "@/components/ui/Input"; import { Button } from "@/components/ui/Button"; import { Section, SectionHeader } from "@/components/ui/Sections"; import { CategoryChips, CategoryOption } from "@/components/ui/CategoryChips"; import { Spacing, Typography, Colors, BorderRadius, Shadows } from "@/constants/theme"; import { Ionicons } from "@expo/vector-icons"; import { useCreateCareAction } from "@/hooks"; import { AppointmentType } from "@/lib/api"; import { useCareActionLinkStore } from "@/stores"; const APPOINTMENT_TYPES: CategoryOption[] = [ { label: 'Analista', value: 'ANALYST', icon: }, { label: 'Psiquiatra', value: 'PSYCHIATRIST', icon: }, { label: 'Clínico', value: 'GP', icon: }, { label: 'Nutricionista', value: 'NUTRITIONIST', icon: }, { label: 'Outro', value: 'OTHER', icon: }, ]; const DURATIONS = [30, 45, 50, 60]; export default function AppointmentCareAction() { const [appointmentType, setAppointmentType] = useState('ANALYST'); const [appointmentDuration, setAppointmentDuration] = useState(50); const [appointmentNote, setAppointmentNote] = useState(''); const createCareAction = useCreateCareAction(); const handleSave = async () => { const result = await createCareAction.mutateAsync({ type: 'APPOINTMENT', moment: new Date(), appointment: { type: appointmentType, duration: appointmentDuration, note: appointmentNote || undefined, }, }); useCareActionLinkStore.getState().setPending(result.careAction.id); router.replace('/care-actions/post-appointment'); }; return ( Registrar consulta Informe os detalhes da consulta ou sessão
{DURATIONS.map((d) => ( setAppointmentDuration(d)} activeOpacity={0.7} > {d} ))}