import { Block } from 'payload';

export const CategoryGrid: Block = {
    slug: 'categoryGrid',
    interfaceName: 'CategoryGridBlock',
    fields: [
        {
            name: 'categories',
            type: 'array',
            required: true,
            minRows: 1,
            fields: [
                {
                    name: 'title',
                    type: 'text',
                    required: true,
                },
                {
                    name: 'description',
                    type: 'textarea',
                    required: false,
                },
                {
                    name: 'image',
                    type: 'upload',
                    relationTo: 'media',
                    required: false,
                },
                {
                    name: 'icon',
                    type: 'upload',
                    relationTo: 'media',
                    required: false,
                },
                {
                    name: 'href',
                    type: 'text',
                    required: true,
                },
                {
                    name: 'ctaLabel',
                    type: 'text',
                    required: false,
                },
            ],
        },
    ],
};
