1package tinyclient23import "strings"45// customViewState is the row state on the Views page: paused when the6// owner or the relay paused the view, active otherwise.7func customViewState(view any) string {8 if valueMap(view)["enabled"] == false {9 return "paused"10 }11 return "active"12}1314// customViewKinds lists the kinds a custom view watches.15func customViewKinds(view any) string {16 return joinValues(valueMap(view)["kinds"])17}1819// customViewLanguages lists the fenced block languages a custom view renders.20func customViewLanguages(view any) string {21 return joinValues(valueMap(view)["languages"])22}2324func joinValues(value any) string {25 items, _ := value.([]any)26 parts := make([]string, 0, len(items))27 for _, item := range items {28 parts = append(parts, plainString(item))29 }30 return strings.Join(parts, ", ")31}