common.go
1package common
2
3import (
4 "github.com/charmbracelet/soft-serve/ui/keymap"
5 "github.com/charmbracelet/soft-serve/ui/styles"
6)
7
8// Common is a struct all components should embed.
9type Common struct {
10 Styles *styles.Styles
11 Keymap *keymap.KeyMap
12 Width int
13 Height int
14}
15
16// SetSize sets the width and height of the common struct.
17func (c *Common) SetSize(width, height int) {
18 c.Width = width
19 c.Height = height
20}