MCPcopy
hub / github.com/wavetermdev/waveterm / defaultHeaderRenderer

Function defaultHeaderRenderer

tsunami/ui/table.go:183–194  ·  view source on GitHub ↗

Default header renderer

(ctx HeaderContext)

Source from the content-addressed store, hash-verified

181
182// Default header renderer
183func defaultHeaderRenderer(ctx HeaderContext) any {
184 return vdom.H("div", map[string]any{
185 "className": "flex items-center gap-2",
186 },
187 vdom.H("span", nil, ctx.Column),
188 vdom.If(ctx.IsSorted,
189 vdom.H("span", map[string]any{
190 "className": "text-blue-400",
191 }, vdom.IfElse(ctx.SortDirection == "asc", "↑", "↓")),
192 ),
193 )
194}
195
196// Helper function to safely call RowClassName function
197func makeRowClassName[T any](rowClassNameFunc func(ctx RowContext[T]) string, rowCtx RowContext[T]) string {

Callers 1

genTableRenderFuncFunction · 0.85

Calls 3

HFunction · 0.92
IfFunction · 0.92
IfElseFunction · 0.92

Tested by

no test coverage detected