Editor/ChitChat/CustomWidgets/TextSeperator.cs
using Editor;

namespace ChitChat.Editor;

public class TextSeperatorWidget : Widget
{
	public TextSeperatorWidget(string text, int textWidth = 30, Widget parent = null) : base(parent)
	{
		Layout = Layout.Column();
		Layout seperatorLayout = Layout.Row();

		Layout.AddSeparator(5, Color.Transparent);
		Label textLabel = new Label(text, this) 
		{
			MaximumWidth = textWidth,
			ContentMargins = new Sandbox.UI.Margin(2, 0, 0, 0)
		};
		textLabel.SetStyles("font-weight: bold;");
		seperatorLayout.Add(textLabel);
		seperatorLayout.Add(new Separator(2) { Color = Theme.Border });
		Layout.Add(seperatorLayout);
		Layout.AddSeparator(5, Color.Transparent);
	}
}