import React, { useState } from 'react'; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, TextInput, Linking, Alert, KeyboardAvoidingView, Platform, } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { SafeAreaView } from 'react-native-safe-area-context'; import { router } from 'expo-router'; import { AppColors, BorderRadius, FontSizes, Spacing } from '@/constants/theme'; interface ContactMethodProps { icon: keyof typeof Ionicons.glyphMap; iconColor: string; iconBgColor: string; title: string; subtitle: string; onPress: () => void; } function ContactMethod({ icon, iconColor, iconBgColor, title, subtitle, onPress, }: ContactMethodProps) { return ( {title} {subtitle} ); } export default function SupportScreen() { const [subject, setSubject] = useState(''); const [message, setMessage] = useState(''); const [category, setCategory] = useState(''); const [isSending, setIsSending] = useState(false); const categories = [ 'Technical Issue', 'Billing Question', 'Feature Request', 'Account Help', 'Emergency', 'Other', ]; const handleCall = () => { Linking.openURL('tel:+15551234567').catch(() => { Alert.alert('Error', 'Unable to make phone call'); }); }; const handleEmail = () => { Linking.openURL('mailto:support@wellnuo.com?subject=Support Request').catch(() => { Alert.alert('Error', 'Unable to open email client'); }); }; const handleChat = () => { Alert.alert( 'Live Chat', 'Connecting to a support agent...\n\nEstimated wait time: 2 minutes', [ { text: 'Cancel', style: 'cancel' }, { text: 'Start Chat', onPress: () => Alert.alert('Coming Soon', 'Live chat feature coming soon!') }, ] ); }; const handleSendTicket = async () => { if (!category) { Alert.alert('Error', 'Please select a category'); return; } if (!subject.trim()) { Alert.alert('Error', 'Please enter a subject'); return; } if (!message.trim()) { Alert.alert('Error', 'Please describe your issue'); return; } setIsSending(true); // Simulate API call await new Promise(resolve => setTimeout(resolve, 1500)); setIsSending(false); Alert.alert( 'Ticket Submitted', 'Thank you for contacting us!\n\nTicket #WN-2024-12345\n\nWe\'ll respond within 24 hours.', [{ text: 'OK', onPress: () => router.back() }] ); }; return ( {/* Quick Contact */} Quick Contact {/* Support Hours */} Support Hours Phone: Mon-Fri 8am-8pm EST Email & Chat: 24/7 Emergency: 24/7 {/* Submit a Ticket */} Submit a Ticket {/* Category */} Category * {categories.map((cat) => ( setCategory(cat)} > {cat} ))} {/* Subject */} Subject * {/* Message */} Message * {/* Attachments hint */} Need to attach screenshots? Reply to your ticket email. {/* Submit Button */} {isSending ? 'Sending...' : 'Submit Ticket'} {/* FAQ Link */} router.push('/profile/help')} > Check our Help Center Find answers to common questions {/* Emergency Notice */} If you're experiencing a medical emergency, please call 911 or your local emergency services immediately. ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: AppColors.surface, }, keyboardView: { flex: 1, }, section: { marginTop: Spacing.md, }, sectionTitle: { fontSize: FontSizes.sm, fontWeight: '600', color: AppColors.textSecondary, paddingHorizontal: Spacing.lg, paddingVertical: Spacing.sm, textTransform: 'uppercase', }, card: { backgroundColor: AppColors.background, }, contactMethod: { flexDirection: 'row', alignItems: 'center', paddingVertical: Spacing.md, paddingHorizontal: Spacing.lg, }, contactIcon: { width: 48, height: 48, borderRadius: BorderRadius.md, justifyContent: 'center', alignItems: 'center', }, contactContent: { flex: 1, marginLeft: Spacing.md, }, contactTitle: { fontSize: FontSizes.base, fontWeight: '500', color: AppColors.textPrimary, }, contactSubtitle: { fontSize: FontSizes.sm, color: AppColors.textSecondary, marginTop: 2, }, divider: { height: 1, backgroundColor: AppColors.border, marginLeft: Spacing.lg + 48 + Spacing.md, }, hoursCard: { flexDirection: 'row', backgroundColor: AppColors.background, marginHorizontal: Spacing.lg, padding: Spacing.md, borderRadius: BorderRadius.lg, alignItems: 'flex-start', }, hoursContent: { flex: 1, marginLeft: Spacing.md, }, hoursTitle: { fontSize: FontSizes.base, fontWeight: '600', color: AppColors.textPrimary, marginBottom: Spacing.xs, }, hoursText: { fontSize: FontSizes.sm, color: AppColors.textSecondary, marginTop: 2, }, formCard: { backgroundColor: AppColors.background, padding: Spacing.lg, }, inputGroup: { marginBottom: Spacing.md, }, label: { fontSize: FontSizes.sm, fontWeight: '600', color: AppColors.textPrimary, marginBottom: Spacing.xs, }, input: { backgroundColor: AppColors.surface, borderRadius: BorderRadius.md, paddingHorizontal: Spacing.md, paddingVertical: Spacing.md, fontSize: FontSizes.base, color: AppColors.textPrimary, borderWidth: 1, borderColor: AppColors.border, }, textArea: { minHeight: 120, paddingTop: Spacing.md, }, categoryContainer: { flexDirection: 'row', flexWrap: 'wrap', marginTop: Spacing.xs, }, categoryChip: { paddingHorizontal: Spacing.md, paddingVertical: Spacing.xs, borderRadius: BorderRadius.full, backgroundColor: AppColors.surface, marginRight: Spacing.xs, marginBottom: Spacing.xs, borderWidth: 1, borderColor: AppColors.border, }, categoryChipSelected: { backgroundColor: AppColors.primary, borderColor: AppColors.primary, }, categoryChipText: { fontSize: FontSizes.sm, color: AppColors.textSecondary, }, categoryChipTextSelected: { color: AppColors.white, }, attachmentHint: { flexDirection: 'row', alignItems: 'center', marginBottom: Spacing.lg, }, attachmentHintText: { fontSize: FontSizes.xs, color: AppColors.textMuted, marginLeft: Spacing.xs, }, submitButton: { backgroundColor: AppColors.primary, borderRadius: BorderRadius.lg, paddingVertical: Spacing.md, alignItems: 'center', }, submitButtonDisabled: { opacity: 0.6, }, submitButtonText: { fontSize: FontSizes.base, fontWeight: '600', color: AppColors.white, }, faqLink: { flexDirection: 'row', alignItems: 'center', backgroundColor: AppColors.background, marginHorizontal: Spacing.lg, padding: Spacing.md, borderRadius: BorderRadius.lg, }, faqLinkContent: { flex: 1, flexDirection: 'row', alignItems: 'center', }, faqLinkText: { marginLeft: Spacing.md, }, faqLinkTitle: { fontSize: FontSizes.base, fontWeight: '500', color: AppColors.textPrimary, }, faqLinkSubtitle: { fontSize: FontSizes.xs, color: AppColors.textMuted, marginTop: 2, }, emergencyNotice: { flexDirection: 'row', alignItems: 'flex-start', backgroundColor: '#FEE2E2', marginHorizontal: Spacing.lg, marginVertical: Spacing.lg, padding: Spacing.md, borderRadius: BorderRadius.lg, }, emergencyText: { flex: 1, fontSize: FontSizes.xs, color: AppColors.error, marginLeft: Spacing.sm, lineHeight: 18, }, });