import React, { useState } from 'react'; import { Text, View, StyleSheet, Pressable } from 'react-native'; import AntDesign from 'react-native-vector-icons/AntDesign'; const Accordion = ({ title, left, right, children, titleStyle = style.text, backgroundColor = 'lightgray', }) => { const [opened, setOpened] = useState(false); const handleOpen = () => { setOpened(!opened) }; return ( {left ? left : null} {title} {right ? right : null} {opened ? children : null} ) }; export const AccordionItem = ({ title, left, right, titleStyle = style.text, backgroundColor = 'lightgray', marginLeft = 20, }) => { return ( {left ? left : null} {title} {right ? right : null} ); }; const style = StyleSheet.create({ flexRow: { flexDirection: 'row', }, flexCenter: { justifyContent: 'center', alignItems: 'center', }, catBox: { justifyContent: 'space-between', paddingVertical: 10, }, rightIcon: { marginHorizontal: 5, fontSize: 20, color: 'black', }, text: { fontSize: 20, marginHorizontal: 10, }, }) export default Accordion