function displayBoughtInsurance(idType, results) {
    let displayDiv = DOM.elid("display-wrapper-bought-insurance");
    displayDiv.innerHTML = "";
    let section = DOM.section();
    // console.log(results[0].value)
    results.map(result => {
        console.log(result, "result")
        for (let key in result) {
            console.log(result[key], "results")
            let rowArrivalTime = new Date(result[key].arrivalTime);
            let rowFlightStatus = result[key].flightStatus;
            let rowTotalInsuredAmount = result[key].totalInsuredAmount;
            let rowIndividualFlightInsurees = result[key].individualFlightInsurees;
            

            let row = section.appendChild(DOM.div({className: 'col-sm-8 field-value', id: idType}, `Arrival Time: ${rowArrivalTime.toString()}, Flight Status: ${rowFlightStatus}, Flight Maximum Individual Insured Amount: ${rowTotalInsuredAmount} ETH, Your Bought Insured Amount: ${rowIndividualFlightInsurees} ETH`))

            section.appendChild(row);
        }
    })

    displayDiv.append(section)

}
// Create a function that displays the passenger insurances bought
Create a function that displays the passenger insurances bought
Create a function that displays the passenger insurances bought
function displayBoughtInsurance(idType, results) {
    let displayDiv = DOM.elid("display-wrapper-bought-insurance");
    displayDiv.innerHTML = "";
    let section = DOM.section();
    results.map(result => {
        console.log(result, "result")
        for (let key in result) {
            console.log(result[key], "results")
            let rowArrivalTime = new Date(result[key].arrivalTime);
            let rowFlightStatus = result[key].flightStatus;
            let rowTotalInsuredAmount = result[key].totalInsuredAmount;
            let rowIndividualFlightInsurees = result[key].individualFlightInsurees;
            let row = section.appendChild(DOM.div({className: 'col-sm-8 field-value', id: idType}, `Arrival Time: ${rowArrivalTime.toString()}, Flight Status: ${rowFlightStatus}, Flight Maximum Individual Insured Amount: ${rowTotalInsuredAmount} ETH, Your Bought Insured Amount: ${rowIndividualFlightInsurees} ETH`))
            section.appendChild(row);
        }
    })
    displayDiv.append(section)
}
function displayBoughtInsurance ( idType , results ) { let displayDiv = DOM . elid ( "display-wrapper-bought-insurance" ) ; displayDiv . innerHTML = "" ; let section = DOM . section ( ) ; results . map ( result => { console . log ( result , "result" ) for ( let key in result ) { console . log ( result [ key ] , "results" ) let rowArrivalTime = new Date ( result [ key ] . arrivalTime ) ; let rowFlightStatus = result [ key ] . flightStatus ; let rowTotalInsuredAmount = result [ key ] . totalInsuredAmount ; let rowIndividualFlightInsurees = result [ key ] . individualFlightInsurees ; let row = section . appendChild ( DOM . div ( { className : 'col-sm-8 field-value' , id : idType } , ` ${ rowArrivalTime . toString ( ) } ${ rowFlightStatus } ${ rowTotalInsuredAmount } ${ rowIndividualFlightInsurees } ` ) ) section . appendChild ( row ) ; } } ) displayDiv . append ( section ) }
Create a function that displays the passenger insurances bought
Create a function that displays the passenger insurances bought
// console.log(results[0].value)