import React, { useState } from 'react'; import { View, Text, StyleSheet, Modal, Platform, KeyboardAvoidingView, TouchableOpacity, ActivityIndicator, TextInput } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import Animated, { FadeInDown } from 'react-native-reanimated'; import { GlassCard } from '../../../components/ui'; import { colors, spacing, radius, typography } from '../../../theme'; interface ResetProgressProps { onResetProgress: () => Promise; } export const ResetProgress: React.FC = ({ onResetProgress }) => { const [showResetModal, setShowResetModal] = useState(false); const [resetConfirmText, setResetConfirmText] = useState(""); const [isResetting, setIsResetting] = useState(false); const handleReset = async () => { if (resetConfirmText !== "RESET") return; setIsResetting(true); try { await onResetProgress(); setShowResetModal(false); setResetConfirmText(""); } catch (error) { // Error handling relies on parent } finally { setIsResetting(false); } }; return ( <> Reset Progress Start Fresh Delete all swipes, matches, and chats while keeping your partner connection. setShowResetModal(true)} activeOpacity={0.7} > Reset !isResetting && setShowResetModal(false)} > Reset Progress? This action cannot be undone. This will permanently delete: All your swipes All matches All chat messages Your partner connection stays Type RESET to confirm: { setShowResetModal(false); setResetConfirmText(""); }} disabled={isResetting} activeOpacity={0.7} > Cancel {isResetting ? ( ) : ( <> Reset )} ); }; const styles = StyleSheet.create({ section: { paddingHorizontal: spacing.lg, marginBottom: spacing.lg, }, sectionTitle: { ...typography.caption1, fontWeight: '600', letterSpacing: 2, color: colors.textTertiary, marginBottom: spacing.sm, textTransform: 'uppercase', }, content: { gap: spacing.md, }, info: { flexDirection: "row", alignItems: "flex-start", }, iconContainer: { width: 44, height: 44, borderRadius: 22, backgroundColor: colors.warningLight, justifyContent: "center", alignItems: "center", }, textContainer: { flex: 1, marginLeft: spacing.md, }, title: { ...typography.headline, color: colors.text, marginBottom: spacing.xs, }, description: { ...typography.subhead, color: colors.textSecondary, lineHeight: 20, }, resetButton: { flexDirection: "row", alignItems: "center", justifyContent: "center", backgroundColor: colors.warningLight, paddingVertical: spacing.sm, paddingHorizontal: spacing.md, borderRadius: radius.md, borderWidth: 1, borderColor: 'rgba(243, 156, 18, 0.3)', gap: spacing.xs, alignSelf: "flex-end", }, resetButtonText: { ...typography.subhead, color: colors.warning, fontWeight: "600", }, // Modal styles modalOverlay: { flex: 1, backgroundColor: "rgba(0, 0, 0, 0.7)", justifyContent: "center", alignItems: "center", padding: spacing.lg, }, modalContent: { width: "100%", maxWidth: 400, padding: spacing.xl, backgroundColor: colors.backgroundLight, borderRadius: radius.xl, borderWidth: 1, borderColor: colors.border, }, modalHeader: { alignItems: "center", marginBottom: spacing.lg, }, modalIconContainer: { width: 64, height: 64, borderRadius: 32, backgroundColor: colors.warningLight, justifyContent: "center", alignItems: "center", marginBottom: spacing.md, }, modalTitle: { ...typography.title2, color: colors.text, textAlign: "center", }, modalDescription: { ...typography.body, color: colors.textSecondary, marginBottom: spacing.lg, textAlign: "center", }, resetList: { backgroundColor: "rgba(243, 156, 18, 0.1)", borderRadius: radius.lg, padding: spacing.md, gap: spacing.sm, marginBottom: spacing.md, borderWidth: 1, borderColor: 'rgba(243, 156, 18, 0.2)', }, resetListItem: { flexDirection: "row", alignItems: "center", gap: spacing.sm, }, resetListText: { ...typography.subhead, color: colors.text, }, keepList: { backgroundColor: "rgba(46, 204, 113, 0.1)", borderRadius: radius.lg, padding: spacing.md, gap: spacing.sm, marginBottom: spacing.xl, borderWidth: 1, borderColor: 'rgba(46, 204, 113, 0.2)', }, keepListItem: { flexDirection: "row", alignItems: "center", gap: spacing.sm, }, keepListText: { ...typography.subhead, color: colors.text, }, confirmLabel: { ...typography.subhead, color: colors.textSecondary, marginBottom: spacing.xs, textAlign: "center", }, confirmKeyword: { fontWeight: "bold", color: colors.warning, }, confirmInput: { backgroundColor: colors.background, borderRadius: radius.md, borderWidth: 1, borderColor: colors.warning, padding: spacing.md, ...typography.body, color: colors.text, textAlign: 'center', marginBottom: spacing.xl, }, modalButtons: { flexDirection: "row", gap: spacing.md, }, cancelButton: { flex: 1, backgroundColor: colors.background, paddingVertical: spacing.md, borderRadius: radius.md, alignItems: "center", borderWidth: 1, borderColor: colors.border, }, cancelButtonText: { ...typography.body, color: colors.textSecondary, fontWeight: "600", }, confirmResetButton: { flex: 1, backgroundColor: colors.warning, paddingVertical: spacing.md, borderRadius: radius.md, alignItems: "center", flexDirection: "row", justifyContent: "center", gap: spacing.xs, }, confirmResetButtonDisabled: { opacity: 0.5, }, confirmResetButtonText: { ...typography.body, color: colors.text, fontWeight: "600", }, });