Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/coffee. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
19 lines
506 B
Go
19 lines
506 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
)
|
|
|
|
// CoffeeButtonBlock renders a button with the kraft-tag override styling.
|
|
// Content shape: {"text": "Click me", "url": "...", "variant": "primary|secondary"}
|
|
func CoffeeButtonBlock(ctx context.Context, content map[string]any) string {
|
|
text := getString(content, "text")
|
|
url := getString(content, "url")
|
|
variant := getString(content, "variant")
|
|
|
|
var buf bytes.Buffer
|
|
_ = coffeeButtonComponent(text, url, variant).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|