47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import React from 'react'
|
|
|
|
import type { ArchiveBlockProps } from './types.js'
|
|
|
|
import { CollectionArchive } from '../../_components/CollectionArchive/index.js'
|
|
import { Gutter } from '../../_components/Gutter/index.js'
|
|
import RichText from '../../_components/RichText/index.js'
|
|
import classes from './index.module.scss'
|
|
|
|
export const ArchiveBlock: React.FC<
|
|
ArchiveBlockProps & {
|
|
id?: string
|
|
}
|
|
> = (props) => {
|
|
const {
|
|
id,
|
|
categories,
|
|
introContent,
|
|
limit,
|
|
populateBy,
|
|
populatedDocs,
|
|
populatedDocsTotal,
|
|
relationTo,
|
|
selectedDocs,
|
|
} = props
|
|
|
|
return (
|
|
<div className={classes.archiveBlock} id={`block-${id}`}>
|
|
{introContent && (
|
|
<Gutter className={classes.introContent}>
|
|
<RichText content={introContent} />
|
|
</Gutter>
|
|
)}
|
|
<CollectionArchive
|
|
categories={categories}
|
|
limit={limit}
|
|
populateBy={populateBy}
|
|
populatedDocs={populatedDocs}
|
|
populatedDocsTotal={populatedDocsTotal}
|
|
relationTo={relationTo}
|
|
selectedDocs={selectedDocs}
|
|
sort="-publishedDate"
|
|
/>
|
|
</div>
|
|
)
|
|
}
|