2019-05-06 04:39:10 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { flatten } from 'lodash';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WooCommerce dependencies
|
|
|
|
*/
|
|
|
|
import { TableCard } from '@woocommerce/components';
|
|
|
|
|
|
|
|
const UpcomingEvents = ( { config } ) => {
|
|
|
|
const rows = flatten(
|
2020-02-14 02:23:21 +00:00
|
|
|
config.map( ( apple ) => {
|
|
|
|
return apple.events.map( ( event ) => {
|
2019-05-06 04:39:10 +00:00
|
|
|
return [
|
|
|
|
{ display: apple.title, value: 'variety' },
|
|
|
|
{ display: event.title, value: 'event' },
|
|
|
|
{ display: event.date, value: 'date' },
|
|
|
|
];
|
|
|
|
} );
|
|
|
|
} )
|
|
|
|
);
|
|
|
|
return (
|
|
|
|
<TableCard
|
|
|
|
title={ 'Upcoming Events' }
|
|
|
|
headers={ [
|
|
|
|
{ label: 'Variety', key: 'variety' },
|
|
|
|
{ label: 'Event', key: 'event' },
|
|
|
|
{ label: 'Date', key: 'date' },
|
|
|
|
] }
|
|
|
|
rows={ rows }
|
|
|
|
rowsPerPage={ 100 }
|
|
|
|
totalRows={ 1 }
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default UpcomingEvents;
|