2022-03-27 04:53:58 +00:00
|
|
|
package tableselect
|
|
|
|
|
|
|
|
import "github.com/charmbracelet/bubbles/list"
|
|
|
|
|
|
|
|
type tableItem struct {
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ti tableItem) FilterValue() string {
|
2022-03-28 10:07:11 +00:00
|
|
|
return ""
|
2022-03-27 04:53:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (ti tableItem) Title() string {
|
|
|
|
return ti.name
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ti tableItem) Description() string {
|
2022-03-27 23:19:38 +00:00
|
|
|
return ""
|
2022-03-27 04:53:58 +00:00
|
|
|
}
|
|
|
|
|
2022-03-27 23:19:38 +00:00
|
|
|
func toListItems(xs []string) []list.Item {
|
2022-03-27 04:53:58 +00:00
|
|
|
ls := make([]list.Item, len(xs))
|
|
|
|
for i, x := range xs {
|
2022-03-27 23:19:38 +00:00
|
|
|
ls[i] = tableItem{name: x}
|
2022-03-27 04:53:58 +00:00
|
|
|
}
|
|
|
|
return ls
|
|
|
|
}
|