package tcelllivepage

import (
	

	am 
	h 
	lp 
)

// compo renders the tcell grid as a livepage component.
type compo struct {
	lp.Compo
	s *Screen
}

var _ lp.CompoLiveApi = (*compo)(nil)

// Mach implements [lp.CompoLiveApi].
func ( *compo) () *am.Machine {
	return .s.mach
}

// Render implements [h.Composer].
func ( *compo) () h.UI {
	,  := .s.Size()

	return h.Div().
		ID(screenID).
		Class("tcell-screen").
		TabIndex(0).
		Aria("label", "terminal").
		DataSet("cols", strconv.Itoa()).
		DataSet("rows", strconv.Itoa()).
		Body(h.Raw(.s.gridHTML()))
}