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 { } } @Section("sv-tags-list", "Tags") { @Meta(tagsSummary(data)) @TagCreateForm() if len(data.Tags) == 0 { @EmptyState("No tags") } else { } } } templ FavoritesControls(data favoritesRenderData) {
@FavoriteCreateTagPicker(data.Tags)
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 {
Tags
for _, tag := range tags { if tag != nil { } }
} } templ FavoriteItem(favorite *entity.Favorite, tags []*entity.Tag) {
  • { favoriteItemLabel(favorite) }

    { favorite.URL }

    if favoriteMetaText(favorite) != "" {

    { favoriteMetaText(favorite) }

    }
    @ButtonIconLabel(iconExternal, "Open")
    @FavoriteEditForm(favorite) @FavoriteTagControls(favorite, tags)
  • } templ FavoriteEditForm(favorite *entity.Favorite) {
    @ShortcutSelect(favorite.ShortcutKey)
    } 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) { }