package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // ReservationBlockMeta defines the reservation strip block. var ReservationBlockMeta = blocks.BlockMeta{ Key: "reservation", Title: "Reservation Strip", Description: "Sticky gold-on-black reservation strip with phone, OpenTable CTA and trading hours.", Source: "art-deco", } // ReservationData is the typed view used by the templ component. type ReservationData struct { Phone string OpenTable string Hours []string } // ReservationBlock renders a reservation strip. // Content: {"phone": "...", "openTable": "...", "hours": ["Tue–Sat · 6pm–late", ...]} func ReservationBlock(ctx context.Context, content map[string]any) string { data := ReservationData{ Phone: getString(content, "phone"), OpenTable: getString(content, "openTable"), Hours: getStringSlice(content, "hours"), } var buf bytes.Buffer _ = reservationComponent(data).Render(ctx, &buf) return buf.String() }