namespace MarkdownEditor.Models;

/// <summary>
/// Represents metadata about a markdown document tab.
/// This model encapsulates the state of a document independently from the view model.
/// </summary>
public class TabInfo
{
    /// <summary>
    /// Gets or sets the display title of the tab.
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// Gets or sets the file system path of the document, if it has been saved.
    /// Null indicates an unsaved document.
    /// </summary>
    public string? FilePath { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether the document has unsaved changes.
    /// </summary>
    public bool IsDirty { get; set; }

    /// <summary>
    /// Gets the display title with dirty indicator.
    /// </summary>
    public string DisplayTitle => IsDirty ? $"{Title} *" : Title;
}

