wwwlayermeshusa/src/blocks/FDAlternateHeroBlock/config.ts

73 lines
1.7 KiB
TypeScript

import type { Block } from 'payload'
export const FDAlternateHeroBlock: Block = {
slug: 'fdAlternateHero',
interfaceName: 'FDAlternateHeroBlock',
labels: {
singular: 'FD Alternativ Hero (centrerad)',
plural: 'FD Alternativa Heroes',
},
fields: [
{
name: 'title',
type: 'text',
required: true,
label: 'Rubrik',
},
{
name: 'description',
type: 'textarea',
label: 'Beskrivning (valfri)',
},
{
name: 'primaryCtaText',
type: 'text',
label: 'Primär CTA-knapp text (valfri)',
},
{
name: 'primaryCtaLink',
type: 'text',
label: 'Primär CTA-knapp länk',
defaultValue: '/kontakt',
},
{
name: 'secondaryCtaText',
type: 'text',
label: 'Sekundär CTA-knapp text (valfri)',
},
{
name: 'secondaryCtaLink',
type: 'text',
label: 'Sekundär CTA-knapp länk',
defaultValue: '#',
},
{
name: 'image',
type: 'upload',
relationTo: 'media',
label: 'Fullbredd bild (visas under texten)',
admin: {
description: 'Bred bild utan border-radius — visas som en full showcase under CTA-knapparna.',
},
},
{
name: 'imageCaption',
type: 'text',
label: 'Bildtext (valfri)',
admin: {
condition: (_, siblingData) => Boolean(siblingData?.image),
},
},
{
name: 'sectionBackground',
type: 'select',
label: 'Sektionsbakgrund',
defaultValue: 'white',
options: [
{ label: 'Vit', value: 'white' },
{ label: 'Navy', value: 'navy' },
{ label: 'Grå', value: 'gray' },
],
},
],
}