diff --git a/src/app/(payload)/blocks/author.ts b/src/app/(payload)/blocks/author.ts new file mode 100644 index 0000000..fc64aea --- /dev/null +++ b/src/app/(payload)/blocks/author.ts @@ -0,0 +1,14 @@ +import type { Block } from 'payload/types' + +const Author: Block = { + slug: 'Author', + fields: [ + { + name: 'author', + type: 'relationship', + relationTo: 'authors', + }, + ], +} + +export default Author diff --git a/src/app/(payload)/blocks/index.ts b/src/app/(payload)/blocks/index.ts index 7be6d16..bba3f1c 100644 --- a/src/app/(payload)/blocks/index.ts +++ b/src/app/(payload)/blocks/index.ts @@ -1,4 +1,5 @@ import RichText from '@payload/blocks/rich-text' +import Author from '@payload/blocks/author' // eslint-disable-next-line import/no-anonymous-default-export -export default [RichText] +export default [RichText, Author] diff --git a/src/components/Blocks/index.tsx b/src/components/Blocks/index.tsx index 440806d..106c905 100644 --- a/src/components/Blocks/index.tsx +++ b/src/components/Blocks/index.tsx @@ -1,4 +1,3 @@ -import Paragraph from '@/app/(payload)/blocks/paragraph' import Author from './Author' import RichText from './RichText' @@ -10,7 +9,6 @@ export type AdditionalBlockProps = { const blockComponents = { Author: Author, RichText: RichText, - Paragraph: Paragraph, } const Blocks = ({ blocks, locale }: any) => {