import { Block } from 'payload'
import { lexicalEditor } from '@payloadcms/richtext-lexical'

export const ThreeColumnBlock: Block = {
  slug: 'threeColumns', // Database ID
  labels: {
    singular: '3 Column Layout',
    plural: '3 Column Layouts',
  },
  fields: [
    {
      name: 'columns',
      type: 'group', // Grouping them keeps the database clean
      fields: [
        {
          name: 'col1',
          type: 'richText',
          label: 'Column 1',
          editor: lexicalEditor({}), // Uses default editor
        },
        {
          name: 'col2',
          type: 'richText',
          label: 'Column 2',
          editor: lexicalEditor({}),
        },
        {
          name: 'col3',
          type: 'richText',
          label: 'Column 3',
          editor: lexicalEditor({}),
        },
      ],
    },
  ],
}