using QuestPDF.Fluent;
using QuestPDF.Infrastructure;

namespace Server
{
    public static class Extensions
    {
        #region Public Method TextSmall

        /// Adds a small text element to the specified container with an optional bold style.
        /// <param name="container">The container to which the text element will be added.</param>
        /// <param name="text">The text content to be displayed.</param>
        /// <param name="bold">Indicates whether the text should be displayed in bold. Defaults to false.</param>
        public static void TextSmall(this IContainer container, string? text, bool bold = false)
        {
            container.Text(txt =>
            {
                var spanDescriptor = txt.Span(text).FontSize(8);
                if (bold) spanDescriptor.SemiBold();
            });
        }

        #endregion
    }
}