import { GlobalConfig } from 'payload'

const ReviewsPage: GlobalConfig = {
  slug: 'reviews-page',
  fields: [
    {
      type: 'tabs',
      tabs: [
        {
          name: 'hero',
          interfaceName: 'reviewsHero',
          label: 'Hero',
          fields: [
            {
              name: 'bg',
              type: 'upload',
              relationTo: 'media',
              label: 'Background',
              required: true,
            },
          ],
        },
        {
          name: 'reviews',
          interfaceName: 'reviewsSection',
          label: 'Reviews',
          fields: [
            {
              name: 'title',
              type: 'text',
              localized: true,
              label: 'Title',
              required: true,
            },
            {
              name: 'subtitle',
              type: 'text',
              localized: true,
              label: 'Subtitle',
              required: true,
            },
          ],
        }
      ],
    },
  ],
  admin: {
    group: 'Pages',
  },
  access: {
    read: () => true,
  },
}

export { ReviewsPage }
