diff --git a/src/blocks/CardGridBlock.ts b/src/blocks/CardGridBlock.ts index b84ad82..f8e3d57 100644 --- a/src/blocks/CardGridBlock.ts +++ b/src/blocks/CardGridBlock.ts @@ -20,11 +20,47 @@ export const CardGridBlock: Block = { minRows: 1, maxRows: 6, fields: [ + { + name: 'mediaType', + type: 'select', + defaultValue: 'none', + label: 'Visuelles Element', + options: [ + { label: 'Keins', value: 'none' }, + { label: 'Bild', value: 'image' }, + { label: 'Icon', value: 'icon' }, + ], + }, { name: 'image', type: 'upload', relationTo: 'media', label: 'Bild', + admin: { + condition: (_, siblingData) => siblingData?.mediaType === 'image', + }, + }, + { + name: 'icon', + type: 'text', + label: 'Icon-Name', + admin: { + description: 'Lucide Icon-Name (z.B. "heart", "star", "shield-check", "camera")', + condition: (_, siblingData) => siblingData?.mediaType === 'icon', + }, + }, + { + name: 'iconPosition', + type: 'select', + defaultValue: 'top', + label: 'Icon-Position', + options: [ + { label: 'Oben', value: 'top' }, + { label: 'Links', value: 'left' }, + ], + admin: { + condition: (_, siblingData) => siblingData?.mediaType === 'icon', + }, }, { name: 'title',