Created empty files & folders for CMS blocks, updated the RootLayout

This commit is contained in:
2025-08-31 11:50:16 +03:00
parent 8997ad9f06
commit a99200b581
42 changed files with 3732 additions and 5 deletions

View File

@ -0,0 +1 @@
//

View File

@ -0,0 +1,21 @@
// import React from 'react'
// import { Code } from './Component.client'
// export type CodeBlockProps = {
// code: string
// language?: string
// blockType: 'code'
// }
// type Props = CodeBlockProps & {
// className?: string
// }
// export const CodeBlock: React.FC<Props> = ({ className, code, language }) => {
// return (
// <div className={[className, 'not-prose'].filter(Boolean).join(' ')}>
// <Code code={code} language={language} />
// </div>
// )
// }

View File

33
src/blocks/Code/config.ts Normal file
View File

@ -0,0 +1,33 @@
import type { Block } from 'payload'
export const Code: Block = {
slug: 'code',
interfaceName: 'CodeBlock',
fields: [
{
name: 'language',
type: 'select',
defaultValue: 'typescript',
options: [
{
label: 'Typescript',
value: 'typescript',
},
{
label: 'Javascript',
value: 'javascript',
},
{
label: 'CSS',
value: 'css',
},
],
},
{
name: 'code',
type: 'code',
label: false,
required: true,
},
],
}