package hubsrht

import (
	"fmt"
	"strings"

	"git.sr.ht/~xenrox/hut/termfmt"
)

func (v Visibility) TermString() string {
	var style termfmt.Style

	switch v {
	case VisibilityPublic:
	case VisibilityUnlisted:
		style = termfmt.Blue
	case VisibilityPrivate:
		style = termfmt.Red
	default:
		panic(fmt.Sprintf("unknown visibility: %q", v))
	}

	return style.String(strings.ToLower(string(v)))
}
