| 1 |
import ContentType from '../../models/content-type'; |
| 2 |
import OverviewContentGroupItem from './overview-content-group-item'; |
| 3 |
import { Heading, CssGrid } from '@elementor/app-ui'; |
| 4 |
|
| 5 |
export default function OverviewContentGroup( props ) { |
| 6 |
if ( props.contentType?.documents?.length <= 0 ) { |
| 7 |
return ''; |
| 8 |
} |
| 9 |
|
| 10 |
return ( |
| 11 |
<div className="e-kit-library__content-overview-group-item"> |
| 12 |
<Heading tag="h3" variant="h3" className="e-kit-library__content-overview-group-title"> |
| 13 |
{ props.contentType.label } |
| 14 |
</Heading> |
| 15 |
<CssGrid spacing={ 24 } colMinWidth={ 250 }> |
| 16 |
{ props.contentType.documents.map( ( document ) => { |
| 17 |
return <OverviewContentGroupItem key={ document.id } document={ document } kitId={ props.kitId } kitTitle={ props.kitTitle } groupData={ props.contentType } />; |
| 18 |
} ) } |
| 19 |
</CssGrid> |
| 20 |
</div> |
| 21 |
); |
| 22 |
} |
| 23 |
|
| 24 |
OverviewContentGroup.propTypes = { |
| 25 |
contentType: PropTypes.instanceOf( ContentType ), |
| 26 |
kitId: PropTypes.string.isRequired, |
| 27 |
kitTitle: PropTypes.string.isRequired, |
| 28 |
}; |
| 29 |
|