Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/terminal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
25 lines
601 B
Go
25 lines
601 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
)
|
|
|
|
// TerminalButtonBlock renders a button label wrapped in [ LABEL ] brackets
|
|
// with a blinking caret on hover (via the .terminal-button class).
|
|
//
|
|
// Content shape (same as built-in button): {text, url, variant, target}.
|
|
func TerminalButtonBlock(ctx context.Context, content map[string]any) string {
|
|
text := getString(content, "text")
|
|
url := getString(content, "url")
|
|
target := getString(content, "target")
|
|
|
|
if text == "" {
|
|
return ""
|
|
}
|
|
|
|
var buf bytes.Buffer
|
|
_ = terminalButtonComponent(text, url, target).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|