@inject IGlossaryService glossaryService

@if (StyleType.Equals("Plain"))
{
    @if (Entity!.Info().Description != "")
    {
        <div>
            <b>Description:</b> @((MarkupString)glossaryService.LinkifyText(Entity.Info().Description))
        </div>
    }

    @if (Entity.Info().Notes != "")
    {
        <div>
            <b>Notes:</b> @((MarkupString)glossaryService.LinkifyText(Entity.Info().Notes))
        </div>
    }

    @if (Entity.Info().FlavorText != "")
    {
        <div>
            <i>@((MarkupString)glossaryService.LinkifyText(Entity.Info().FlavorText))</i>
        </div>
    }

    <div class="infoDisplayContainer">
        <div>
            @if (Entity.Faction() != null)
            {
                <div>
                    <b>Faction:</b> @EntityData.Get()[Entity.Faction().Faction].Info().Name
                </div>
            }
            @if (Entity.Tier() != null)
            {
                <div>
                    <b>Tier:</b> @Entity.Tier().Tier
                </div>
            }
        </div>

        @if (Entity.Hotkey() != null)
        {
            <div>
                <div>
                    <b>Hotkey Group:</b> @Entity.Hotkey().HotkeyGroup
                </div>
                <div>
                    <b>Hotkey:</b> @Entity.Hotkey().Hotkey
                </div>
                <div>
                    <b>Hold Space:</b> @(Entity.Hotkey().HoldSpace ? "Yes" : "No")
                </div>
            </div>
        }
    </div>
}
else
{
    <EntityDisplayComponent Title="Info">
        @if (Entity!.Info().Description != "")
        {
            <div>
                <b>Description:</b> @((MarkupString)glossaryService.LinkifyText(Entity.Info().Description))
            </div>
        }

        @if (Entity.Info().Notes != "")
        {
            <div>
                <b>Notes:</b> @((MarkupString)glossaryService.LinkifyText(Entity.Info().Notes))
            </div>
        }

        <div class="infoDisplayContainer">
            <div>
                @if (Entity.Faction() != null)
                {
                    <div>
                        <b>Faction:</b> @EntityData.Get()[Entity.Faction().Faction].Info().Name
                    </div>
                }
                @if (Entity.Tier() != null)
                {
                    <div>
                        <b>Tier:</b> @Entity.Tier().Tier
                    </div>
                }
            </div>

            @if (Entity.Hotkey() != null)
            {
                <div>
                    <div>
                        <b>Hotkey Group:</b> @Entity.Hotkey().HotkeyGroup
                    </div>
                    <div>
                        <b>Hotkey:</b> @Entity.Hotkey().Hotkey
                    </div>
                    <div>
                        <b>Hold Space:</b> @(Entity.Hotkey().HoldSpace ? "Yes" : "No")
                    </div>
                </div>
            }
        </div>


    </EntityDisplayComponent>


    <style>
        .infoDisplayContainer {
            display: flex;
            gap: 32px;
        }

        @@media only screen and (max-width: 1025px) {
            .infoDisplayContainer {
                flex-direction: column;
                gap: 4px;
            }
        }
    </style>
}



@code {

    [CascadingParameter] public EntityModel? Entity { get; set; }

    [CascadingParameter] public string StyleType { get; set; } = "Detailed";

}