This commit is contained in:
Diana 2024-10-15 16:06:49 -05:00
parent 05bd3a01ee
commit a904773bab
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,7 @@
package components
type ContentBadge struct {
Text string
TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, (default secondary)
IsOutline bool
}

View file

@ -0,0 +1,7 @@
{{define "content_badge"}}
<span class="badge {{if eq .IsOutline true}}
border border-{{.TypeClass}} bg-{{.TypeClass}}-subtle text-{{.TypeClass}}-emphasis
{{else}}
text-bg-{{if .TypeClass}}{{.TypeClass}}{{else}}secondary{{end}}
{{end}} rounded-pill ">{{.Text}}</span>
{{end}}