import type { Block } from 'payload';

const TestimonialBlock: Block = {
  slug: 'testimonial',
  imageURL: '/admin/blocks/testimonials.png',
  labels: {
    singular: 'Testimonial Block',
    plural: 'Testimonial Blocks',
  },
  fields: [
    {
      name: 'testimonials',
      type: 'array',
      fields: [
        {
          name: 'quote',
          type: 'textarea',
          required: true,
        },
        {
          name: 'author',
          type: 'text',
        },
        {
          name: 'position',
          type: 'text',
        },
        {
          name: 'image',
          type: 'upload',
          relationTo: 'media',
        },
      ],
    },
      {
      name: 'style',
      type: 'select',
      admin: {
        position: 'sidebar',
      },
      options: [
        {
          label: 'Light BG',
          value: 'light',
        },
        {
          label: 'Dark BG',
          value: 'dark',
        },
      ],
      defaultValue: 'light',
      required: true,
    },
  ],
};

export default TestimonialBlock;