import { Block } from 'payload'

export const GalleryBlock: Block = {
  slug: 'gallery',
  fields: [
    {
      name: 'items',
      label: {
        de: 'Bilder'
      },
      type: 'array',
      required: true,
      fields: [
        {
          name: 'photo',
          label: {
            de: 'Bild'
          },
          type: 'upload',
          relationTo: 'media',
          required: true
        },
        {
          name: 'caption',
          label: {
            de: 'Bildunterschrift'
          },
          type: 'text'
        },
      ],
      minRows: 3,
      maxRows: 12
    }
  ]
}