package components

import (
	"github.com/vugu/vugu"
)

type TextEntry struct {
	Value   string `vugu:"data"`
	runeVal []rune
	visible []bool
}

func (t *TextEntry) Init(ctx vugu.InitCtx) {
	t.runeVal = []rune(t.Value)
	for range t.runeVal {
		t.visible = append(t.visible, true)
	}
}

func (t *TextEntry) visibleStateClassFor(i int) string {
	if t.visible[i] {
		return "revealed"
	}
	return "concealed"
}