using Avalonia.Controls;
using Markdig.Syntax;

namespace MarkdownEditor.Views.Renderers;

/// <summary>
/// Interface for rendering markdown blocks into Avalonia controls.
/// Allows for modular rendering of different markdown block types.
/// </summary>
public interface IMarkdownBlockRenderer
{
    /// <summary>
    /// Determines if this renderer can handle the given block type.
    /// </summary>
    /// <param name="block">The markdown block to check.</param>
    /// <returns>True if this renderer can handle the block, false otherwise.</returns>
    bool CanRender(Block block);

    /// <summary>
    /// Renders the markdown block into an Avalonia control.
    /// </summary>
    /// <param name="block">The markdown block to render.</param>
    /// <returns>The rendered Avalonia control, or null if rendering fails.</returns>
    Control? Render(Block block);
}

