import { Block } from 'payload';

export const HomeHero: Block = {
    slug: 'homeHero',
    interfaceName: 'HomeHeroBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
        { name: 'ctaLabel', type: 'text', localized: true },
        { name: 'secondaryCtaLabel', type: 'text', localized: true },
    ],
};

export const HomeProductCategories: Block = {
    slug: 'homeProductCategories',
    interfaceName: 'HomeProductCategoriesBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
    ],
};

export const HomeWhatWeDo: Block = {
    slug: 'homeWhatWeDo',
    interfaceName: 'HomeWhatWeDoBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
        { name: 'expertiseLabel', type: 'text', localized: true },
        { name: 'quote', type: 'textarea', localized: true },
        {
            name: 'items',
            type: 'array',
            localized: true,
            fields: [
                { name: 'title', type: 'text' },
                { name: 'description', type: 'textarea' },
            ],
        },
    ],
};

export const HomeRecentPosts: Block = {
    slug: 'homeRecentPosts',
    interfaceName: 'HomeRecentPostsBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
    ],
};

export const HomeExperience: Block = {
    slug: 'homeExperience',
    interfaceName: 'HomeExperienceBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
        { name: 'paragraph1', type: 'textarea', localized: true },
        { name: 'paragraph2', type: 'textarea', localized: true },
        { name: 'badge1', type: 'text', localized: true },
        { name: 'badge1Text', type: 'text', localized: true },
        { name: 'badge2', type: 'text', localized: true },
        { name: 'badge2Text', type: 'text', localized: true },
    ],
};

export const HomeWhyChooseUs: Block = {
    slug: 'homeWhyChooseUs',
    interfaceName: 'HomeWhyChooseUsBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
        { name: 'tagline', type: 'text', localized: true },
        {
            name: 'features',
            type: 'array',
            localized: true,
            fields: [{ name: 'feature', type: 'text' }],
        },
        {
            name: 'items',
            type: 'array',
            localized: true,
            fields: [
                { name: 'title', type: 'text' },
                { name: 'description', type: 'textarea' },
            ],
        },
    ],
};

export const HomeMeetTheTeam: Block = {
    slug: 'homeMeetTheTeam',
    interfaceName: 'HomeMeetTheTeamBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
        { name: 'description', type: 'textarea', localized: true },
        { name: 'ctaLabel', type: 'text', localized: true },
        { name: 'networkLabel', type: 'text', localized: true },
    ],
};

export const HomeGallery: Block = {
    slug: 'homeGallery',
    interfaceName: 'HomeGalleryBlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
    ],
};

export const HomeVideo: Block = {
    slug: 'homeVideo',
    interfaceName: 'HomeVideoBlock',
    fields: [{ name: 'title', type: 'text', localized: true }],
};

export const HomeCTA: Block = {
    slug: 'homeCTA',
    interfaceName: 'HomeCTABlock',
    fields: [
        { name: 'title', type: 'text', localized: true },
        { name: 'subtitle', type: 'text', localized: true },
        { name: 'description', type: 'textarea', localized: true },
        { name: 'buttonLabel', type: 'text', localized: true },
    ],
};

export const homeBlocksArray = [
    HomeHero,
    HomeProductCategories,
    HomeWhatWeDo,
    HomeRecentPosts,
    HomeExperience,
    HomeWhyChooseUs,
    HomeMeetTheTeam,
    HomeGallery,
    HomeVideo,
    HomeCTA,
];
