I would like to map through the array, so inside one of the column there would be only 3 items. So first there would be 3 items inside of the column, and then it would map through another column. Should I double map it somehow?
So it would be: Column div => 3 items maps inside => Column div
Data:
const files = {
columnOne: [
{
item: {
className: X,
icon: X,
typographyHeader: X,
typographyDeemphasized: X,
},
},
{
item: {
className: X,
icon: X,
typographyHeader: X,
typographyDeemphasized: X,
},
},
{
item: {
className: X,
icon: X,
typographyHeader: X,
typographyDeemphasized: X,
},
},
],
columnTwo: [
{
item: {
className: X,
icon: X,
typographyHeader: X,
typographyDeemphasized: X,
},
},
{
item: {
className: X,
icon: X,
typographyHeader: X,
typographyDeemphasized: X,
},
},
{
item: {
className: X,
icon: X,
typographyHeader: X,
typographyDeemphasized: X,
},
},
],
};
Structure of the map so far:
const details = files.column.map((singleFile) => {
return (
<div className={classes.column}>
<div className={classes.indicator}>
<div className={classes.item}>
<Icon fontSize="small" className={singleFile.item.className}>
{singleFile.item.icon}
</Icon>
<Typography className={`${classes.header} ${classes.typography}`} variant="subtitle1">
{singleFile.item.typographyHeader}
</Typography>
</div>
<div className={classes.item}>
<Icon fontSize="small" className={classes.hidden}>
check_circle
</Icon>
<Typography className={`${classes.deemphasized} ${classes.typography}`} variant="body2">
{singleFile.item.typographyDeemphasized}
</Typography>
</div>
</div>
</div>
);
});
column), is that a typo in the example code, or do you actually have multiple column keys?