package systemviews
import (
"fmt"
"github.com/bnema/dumber/internal/domain/entity"
)
templ FavoritesView(data favoritesRenderData) {
@Alert("success", data.Notice)
@Alert("error", data.Error)
@Section("sv-favorites-controls", "Manage favorites") {
@FavoritesControls(data)
}
@Section("sv-favorites-list", "Favorites") {
@Meta(favoritesSummary(data))
if len(data.Favorites) == 0 {
@EmptyState("No favorites")
} else {
for _, favorite := range data.Favorites {
if favorite != nil {
@FavoriteItem(favorite, data.Tags)
}
}
}
}
@Section("sv-tags-list", "Tags") {
@Meta(tagsSummary(data))
@TagCreateForm()
if len(data.Tags) == 0 {
@EmptyState("No tags")
} else {
for _, tag := range data.Tags {
if tag != nil {
@TagItem(tag)
}
}
}
}
}
templ FavoritesControls(data favoritesRenderData) {
Tags
for _, tag := range data.Tags {
if tag != nil {
}
}
Keys: j/k move, Enter open, e edit title, d delete focused favorite.
}
templ FavoriteCreateTagPicker(tags []*entity.Tag) {
if len(tags) > 0 {
}
}
templ FavoriteItem(favorite *entity.Favorite, tags []*entity.Tag) {
@FavoriteEditForm(favorite)
@FavoriteTagControls(favorite, tags)
}
templ FavoriteEditForm(favorite *entity.Favorite) {
}
templ FavoriteTagControls(favorite *entity.Favorite, tags []*entity.Tag) {
if len(tags) > 0 {
Tags
for _, tag := range tags {
if tag != nil {
}
}
}
}
templ TagCreateForm() {
}
templ TagItem(tag *entity.Tag) {
}
templ ShortcutSelect(selected *int) {
}