package homeview import "github.com/tigorlazuardi/redmage/models" import "fmt" import "github.com/tigorlazuardi/redmage/views/utils" import "strconv" import "github.com/alecthomas/units" type ImageCardOption uint func (o ImageCardOption) Has(opt ImageCardOption) bool { return o&opt != 0 } const ( HideTitle ImageCardOption = 1 << iota HideDescription HideSubreddit HidePoster ) templ RecentlyAddedImageCard(data *models.Image, opts ImageCardOption) {
Width
{ strconv.Itoa(int(data.ImageWidth)) } px
Height
{ strconv.Itoa(int(data.ImageHeight)) } px
Size
{ units.MetricBytes(data.ImageSize).Round(1).String() }