themes-y2k/button_override.go
Alex Dunmow 49f9c90589 initial: theme plugin y2k
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/y2k.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:46 +08:00

29 lines
703 B
Go

package main
import (
"bytes"
"context"
)
// Y2KButtonBlock applies the plastic-bevel styling to the built-in button.
// Content: {text, url, variant, class}
func Y2KButtonBlock(ctx context.Context, content map[string]any) string {
data := Y2KButtonData{
Text: getStringOr(content, "text", "button"),
URL: getStringOr(content, "url", "#"),
Variant: getStringOr(content, "variant", "primary"),
Class: getString(content, "class"),
}
var buf bytes.Buffer
_ = y2kButtonComponent(data).Render(ctx, &buf)
return buf.String()
}
// Y2KButtonData is the typed shape for the templ component.
type Y2KButtonData struct {
Text string
URL string
Variant string
Class string
}