package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // BotanicalDividerBlockMeta defines metadata for the botanical divider block. var BotanicalDividerBlockMeta = blocks.BlockMeta{ Key: "botanical_divider", Title: "Botanical Divider", Description: "Hand-illustrated SVG section break", Source: "earthen", Category: blocks.CategoryLayout, } // BotanicalDividerBlock renders the botanical divider block. // Content shape: {motif:"fern"|"root"|"seed"} func BotanicalDividerBlock(ctx context.Context, content map[string]any) string { motif := getString(content, "motif") switch motif { case "fern", "root", "seed": default: motif = "fern" } data := BotanicalDividerData{ Motif: motif, Empty: len(content) == 0, } var buf bytes.Buffer _ = botanicalDividerComponent(data).Render(ctx, &buf) return buf.String() } // BotanicalDividerData contains data for the divider component. type BotanicalDividerData struct { Motif string Empty bool }