import { Ionicons } from "@expo/vector-icons"; import { TouchableOpacity, View, Text } from "react-native"; import { IoniconsType } from "../../lib/types"; export interface AccordionItem { title: string; description: string | React.ReactNode; icon: IoniconsType; } export function Accordion({ title, description, icon, isExpanded, onToggle, }: { isExpanded: boolean; onToggle: () => void; } & AccordionItem) { return ( {title} {!isExpanded && typeof description === "string" && ( {description} )} {isExpanded && ( {typeof description === "string" ? ( {description} ) : ( description )} )} ); }