import { IonAccordion, IonAccordionGroup, IonCard, IonContent, IonHeader, IonItem, IonLabel, IonPage, IonTitle, IonToolbar} from '@ionic/react'; import './Flag.css'; // generate single accordion item given a title and points of info const AccordionItem = (title: string, content: string[]) => { return ( {title}
{ // generate each point in content content.map((text: string) =>{ return ( {text} ); }) }
) } const Flag: React.FC = () => { // Load Flag.json which has format of Object[], // where each object has a title and content field. let content = require("./Flag.json") return ( TPC Flag { // generate an accordion item for each object in Flag.json content.map((obj: any) => AccordionItem(obj.title, obj.content)) } ); } export default Flag;