Files
parcoursmob/core/utils/icons/svg-icons.go
2025-10-14 18:11:13 +02:00

27 lines
375 B
Go
Executable File

package icons
import (
"fmt"
"html/template"
)
type IconSet struct {
Icons map[string]string
}
func NewIconSet(set map[string]string) IconSet {
return IconSet{
Icons: set,
}
}
func (i IconSet) Icon(name string, classes string) template.HTML {
icon, ok := i.Icons[name]
if !ok {
return template.HTML("")
}
return template.HTML(fmt.Sprintf(icon, classes))
}