feat(blocks): add icon support to CardGridBlock

Cards can now display a Lucide icon as alternative to an image,
with configurable position (top/left). Fields show conditionally
based on mediaType selection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2026-02-16 14:07:51 +00:00
parent 8abf3a346e
commit 85c76a1eb4

View file

@ -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',