package tui

import "github.com/charmbracelet/lipgloss"

// DrawBox draws a Unicode box around content with the given width and style.
func DrawBox(content string, width int, style lipgloss.Style) string {
	fill := lipgloss.NewStyle().Render(
		lipgloss.PlaceHorizontal(width-2, lipgloss.Left, BoxH, lipgloss.WithWhitespaceChars(BoxH)),
	)
	topLine := style.Render(BoxTL + fill + BoxTR)
	bottomLine := style.Render(BoxBL + fill + BoxBR)

	return topLine + "\n" + content + "\n" + bottomLine
}
