@namespace Oqtane.UI
@inject SiteState SiteState

@if (PageState.RenderMode == RenderModes.Interactive || ModuleState.RenderMode == RenderModes.Static)
{
    <RenderModeBoundary ModuleState="@ModuleState" PageState="@PageState" SiteState="@SiteState" />
}
else
{
    <RenderModeBoundary ModuleState="@ModuleState" PageState="@PageState" SiteState="@SiteState" @rendermode="@InteractiveRenderMode.GetInteractiveRenderMode(PageState.Site.Runtime, PageState.Site.Prerender)" />
}

@code {
    // this component is on the static side of the render mode boundary
    // it passes state as serializable parameters across the boundary 

    [CascadingParameter]
    protected PageState PageState { get; set; }

    [CascadingParameter]
    private Module ModuleState { get; set; }


    [Obsolete("AddModuleMessage is deprecated. Use AddModuleMessage in ModuleBase instead.", false)]
    public void AddModuleMessage(string message, MessageType type)
    {
    }

    [Obsolete("AddModuleMessage is deprecated. Use ModuleBase.AddModuleMessage instead.", false)]
    public void AddModuleMessage(string message, MessageType type, string position)
    {
    }

    [Obsolete("ShowProgressIndicator is deprecated. Use ShowProgressIndicator in ModuleBase instead.", false)]
    public void ShowProgressIndicator()
    {
    }

    [Obsolete("HideProgressIndicator is deprecated. Use HideProgressIndicator in ModuleBase instead.", false)]
    public void HideProgressIndicator()
    {
    }
}
