namespace Htmx.ApiDemo.Templates.Components; /// /// shadcn-style Separator component. /// Orientation: horizontal | vertical /// public sealed class Separator : SeparatorBase { private readonly byte[] _classesData; private readonly byte[] _orientationData; public Separator(string orientation = "horizontal", string extraClasses = "") { var cls = orientation == "vertical" ? $"inline-block h-full w-px bg-border {extraClasses}" : $"block h-px w-full bg-border {extraClasses}"; _classesData = cls.Trim().ToUtf8Bytes(); _orientationData = orientation.ToUtf8Bytes(); } protected override void RenderClasses(HtmxRenderContext ctx) => ctx.Writer.WriteUtf8(_classesData); protected override void RenderOrientation(HtmxRenderContext ctx) => ctx.Writer.WriteUtf8(_orientationData); }