mirror of
https://github.com/anotherhadi/ilovetui.git
synced 2026-08-21 12:05:49 +02:00
5f99fa7521
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
20 lines
509 B
Go
20 lines
509 B
Go
package bubbles
|
|
|
|
import (
|
|
"charm.land/bubbles/v2/table"
|
|
|
|
"github.com/anotherhadi/ilovetui/style"
|
|
)
|
|
|
|
// NewTable returns a table.Model styled with the active theme. Any opts are
|
|
// forwarded to table.New before the theme is applied.
|
|
func NewTable(opts ...table.Option) table.Model {
|
|
t := table.New(opts...)
|
|
s := table.DefaultStyles()
|
|
s.Header = s.Header.Foreground(style.S.Primary)
|
|
s.Cell = s.Cell.Foreground(style.S.Text)
|
|
s.Selected = s.Selected.Foreground(style.S.Primary)
|
|
t.SetStyles(s)
|
|
return t
|
|
}
|