const monthsArray = [
{
month: 'February',
className: 'February',
weeks: [
{
day: '04',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '11',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '18',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '25',
dayofWeek: 'Thur',
status: 'Available +',
},
]
},
{
month: 'March',
className: 'March',
weeks: [
{
day: '04',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '11',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '18',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '25',
dayofWeek: 'Thur',
status: 'Available +',
},
]
},
{
month: 'April',
className: 'April',
weeks: [
{
day: '01',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '08',
dayofWeek: 'Thur',
status: 'Not Available',
},
{
day: '15',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '22',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '28',
dayofWeek: 'Thur',
status: 'Available +',
},
]
},
{
month: 'May',
className: 'May',
weeks: [
{
day: '06',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '13',
dayofWeek: 'Thur',
status: 'Available +',
},
{
day: '20',
dayofWeek: 'Thur',
status: 'Not Available',
},
{
day: '27',
dayofWeek: 'Thur',
status: 'Available +',
},
]
},
];
const WeekShow = () => {
return (
<React.Fragment>
<div className="container">
<div className="row">
<div className="col-md-4 col-sm-4 col-xs-4">
{monthsArray.map((monthValues) => (
<div key={monthValues.month}>
<span>{monthValues.month}</span>
{monthValues.weeks.map((weekValues) => (
<div key={weekValues.day} className="card">
<h5>{weekValues.dayofWeek}</h5>
<h5>{weekValues.day}</h5>
<h5>{weekValues.status}</h5>
</div>
))}
</div>
))}
</div>
</div>
</div>
</React.Fragment>
);
}
ReactDOM.render(
<WeekShow />,
root
);
span {
margin-right: 10px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<div id="root"></div>