package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // LocationCardBlockMeta defines metadata for the location_card block. var LocationCardBlockMeta = blocks.BlockMeta{ Key: "location_card", Title: "Location Card", Description: "Address card with optional static map image and doodled pin overlay", Source: "coffee", } // LocationCardBlock renders a location card. // Content shape: {"address": "...", "mapImage": "...", "directionsUrl": "..."} func LocationCardBlock(ctx context.Context, content map[string]any) string { data := LocationCardData{ Address: getString(content, "address"), MapImage: getString(content, "mapImage"), DirectionsURL: getString(content, "directionsUrl"), } var buf bytes.Buffer _ = locationCardComponent(data).Render(ctx, &buf) return buf.String() } // LocationCardData holds the data the template needs. type LocationCardData struct { Address string MapImage string DirectionsURL string }