import { StyleSheet } from "react-native";
import { List } from "react-native-paper";

export default function MyListAccordion({ listAccordions }) {
  return (
    <List.Section style={{ marginTop: 20 }}>
      {listAccordions.map((accordion, i) => (
        <List.Accordion
          key={i}
          style={styles.listAccordion}
          title={accordion.title}
          left={(props) => <List.Icon {...props} icon={accordion.icon} />}
        >
          <>{accordion.children}</>
        </List.Accordion>
      ))}
    </List.Section>
  );
}

const styles = StyleSheet.create({
  listAccordion: {
    borderRadius: 20,
    backgroundColor: "#3f4042",
    marginBottom: 20,
    elevation: 5,
  },
});
