import React, { Fragment } from 'react'; import { ThemeProvider } from 'styled-components'; import _ from 'lodash'; import { NestedDataProps } from '../../interface'; import { NestedDataContainer, NestedDataRow } from './styledComponents'; import NestedDataItem from './NestedDataItem/NestedDataItem'; const NestedData = (props: NestedDataProps): JSX.Element => { const { theme, data, headers } = props; return ( {data.map((item, dataIndex) => ( {headers.map((header, headerIndex) => { const value: string | number = _.get(item, header.propertyKey); const link: string | null = _.get(item, 'link', null); const isAction = header.propertyKey === 'action'; const isFirst = headerIndex === 0; return ( {!isAction && ( )} ); })}
))} ); }; NestedData.propTypes = {}; export default NestedData;