package ui import "fmt" type AnimeCardProps struct { ID int Title string ImageURL string // Options to customize the card behavior Class string // override default wrapper class ImgClass string // override default image class TitleClass string // override default title class CurrentNode bool // if true, renders a div instead of an anchor tag (useful for graph nodes) } templ AnimeCard(props AnimeCardProps) { if props.CurrentNode {
if props.ImageURL != "" { { } else {
No image
}
{ props.Title }
{ children... }
} else { if props.Class == "notification-card" || props.Class == "schedule-card" {
if props.ImageURL != "" { { } else {
No image
}
} else { if props.ImageURL != "" { { } else {
No image
} } if props.Class != "notification-card" && props.Class != "schedule-card" {
{ props.Title }
} { children... }
} } func defaultString(val, fallback string) string { if val == "" { return fallback } return val }