import { Linking, ScrollView, View } from "react-native"; import { useState } from "react"; import { Alert } from "react-native"; import { useTranslation } from "react-i18next"; import { Badge } from "@/components/ui/Badge"; import { Button, IconButton } from "@/components/ui/Button"; import { Card } from "@/components/ui/Card"; import { Chip } from "@/components/ui/Chip"; import { Field, SwitchRow } from "@/components/ui/Field"; import { AppHeader } from "@/components/ui/Header"; import { Screen } from "@/components/ui/Screen"; import { Text } from "@/components/ui/Text"; import { useEmergencyContactStore } from "@/lib/stores/emergencyContactStore"; import { colors, gutter } from "@/lib/theme"; const RELATIONSHIPS = ["spouse", "parent", "child", "sibling", "friend", "other"] as const; export default function EmergencyContactsScreen() { const { t } = useTranslation(); const contacts = useEmergencyContactStore((s) => s.contacts); const add = useEmergencyContactStore((s) => s.add); const remove = useEmergencyContactStore((s) => s.remove); const grace = useEmergencyContactStore((s) => s.graceMinutesDefault); const setGrace = useEmergencyContactStore((s) => s.setGrace); const escalationEnabled = useEmergencyContactStore((s) => s.escalationEnabled); const setEscalationEnabled = useEmergencyContactStore((s) => s.setEscalationEnabled); const [name, setName] = useState(""); const [phone, setPhone] = useState(""); const [relationship, setRelationship] = useState<(typeof RELATIONSHIPS)[number]>("spouse"); return ( setGrace(Number(v) || 30)} hint="Minutes to wait before notifying your contact" /> Add contact Relationship {RELATIONSHIPS.map((r) => ( setRelationship(r)} size="sm" /> ))}