@using WebSharpRSS.Models
@using ToolQit.Extensions


@if (FeedItem != null)
{
    <div style="justify-self: start;" class="d-flex align-center">
        @if (FeedItem.SyndicationParent.ImageUrl != null)
        {
            <MudImage Src="@FeedItem.SyndicationParent.ImageUrl" ObjectFit="ObjectFit.Contain" Width="32" Height="32"/>
        }
        <div class="d-inline px-3 align-center" style="font-size: 30px;">
            @((MarkupString)(FeedItem?.Title ?? "This item doesn't contains a title!"))
        </div>
    </div>
    <MudDivider DividerType="DividerType.FullWidth" Light="false" Class="my-2"/>
    <div>
        @((MarkupString)((FeedItem?.Content == null || FeedItem.Content.IsNullEmptyWhiteSpace() ? FeedItem?.Description : FeedItem.Content) ?? "This item doesn't contain any content!"))
    </div>
}
else
{
    <MudAlert Severity="Severity.Error" Variant="Variant.Filled">Could not load data!</MudAlert>
}

@code {
    [Parameter]
    public SyndicationItemData? FeedItem { get; set; }
}