func()

in tui/components.go [80:137]


func (d description) render() string {
	doc := strings.Builder{}

	list, additionalText := d.parse()

	columns := []table.Column{
		{Title: "", Width: list.longest("item") + 10},
		{Title: "", Width: list.longest("product") + 10},
	}

	rows := []table.Row{}

	for _, v := range list {
		rows = append(rows, table.Row{
			titleStyle.Render(v.item),
			strong.Render(v.product),
		})
	}

	t := table.New(
		table.WithColumns(columns),
		table.WithRows(rows),
		table.WithFocused(true),
		table.WithHeight(len(list)),
	)

	t.SetStyles(tableStyle)

	if len(list) > 0 {
		doc.WriteString(normal.Render("This process will install the following resources:"))
		doc.WriteString(t.View())
		doc.WriteString("\n\n")
	}

	for _, v := range additionalText {
		doc.WriteString(normal.Render(v))
		doc.WriteString("\n\n")
	}

	doc.WriteString(normal.Render("It's going to take around "))
	doc.WriteString(strong.Render(strconv.Itoa(d.stack.Config.Duration)))

	if d.stack.Config.Duration == 1 {
		doc.WriteString(normal.Render(" minute."))
	} else {
		doc.WriteString(normal.Render(" minutes."))
	}
	doc.WriteString("\n\n")

	if len(d.stack.Config.DocumentationLink) > 0 {
		doc.WriteString(normal.Render("If you would like more information about this stack, "))
		doc.WriteString(normal.Render("please read the documentation at: "))
		doc.WriteString(url.Render(d.stack.Config.DocumentationLink))
		doc.WriteString("\n\n")
	}

	return doc.String()
}