/** * Expandable FAQ Item component for mobile */ import React from 'react'; import { View, Text, TouchableOpacity, LayoutAnimation, Platform, UIManager } from 'react-native'; import type { FAQItem as FAQItemType } from '@manacore/shared-help-types'; // Enable LayoutAnimation on Android if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) { UIManager.setLayoutAnimationEnabledExperimental(true); } interface FAQItemProps { item: FAQItemType; expanded?: boolean; onToggle?: () => void; } export function FAQItem({ item, expanded = false, onToggle }: FAQItemProps) { function handlePress() { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); onToggle?.(); } // Strip HTML tags for mobile display const plainAnswer = item.answer.replace(/<[^>]*>/g, '').trim(); return ( {item.question} {expanded && ( {plainAnswer} )} ); }