// Item de navegação da sidebar: ícone (sempre visível) + rótulo (some abaixo de
// 900px de largura — ver @media abaixo, espelhando o breakpoint em que a
// sidebar encolhe no shell.gv).
component {
props {
prop(name = label)
prop(name = icon)
prop(name = target)
prop(name = action)
}
resources {
style """
.nav_row_on { width: fill; padding: 11 14; spacing: 10; align-y: center; color: var(--blue); cursor: pointer; }
.nav_row_off { width: fill; padding: 11 14; spacing: 10; align-y: center; color: var(--surface); cursor: pointer; }
.nav_icon_on { size: 14; color: var(--text); }
.nav_icon_off { size: 14; color: var(--faint); }
.nav_label_on { color: var(--text); }
.nav_label_off { color: var(--muted); }
"""
}
button(
class = nav_row_on,
if = @view,
one_of = @target,
on_click = @action,
tooltip = @label,
) {
text(class = nav_icon_on, content = "@icon")
text(class = nav_label_on, content = "@label")
}
button(class = nav_row_off, else, on_click = @action, tooltip = @label) {
text(class = nav_icon_off, content = "@icon")
text(class = nav_label_off, content = "@label")
}
}