@namespace Oqtane.Themes
@inherits ContainerBase
@inject NavigationManager NavigationManager

<div class="app-admin-modal">
    <div class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><ModuleTitle /></h5>
                    <form method="post" class="app-form-button" @formname="AdminContainerForm" @onsubmit="@CloseModal">
                        <input type="hidden" name="__RequestVerificationToken" value="@SiteState.AntiForgeryToken" />
                        <button type="submit" class="btn-close" aria-label="Close"></button>
                    </form>
                </div>
                <div class="modal-body">
                    <ModuleInstance />
                </div>
            </div>
        </div>
    </div>
</div>

@code {
	private void CloseModal()
	{
		NavigationManager.NavigateTo((!string.IsNullOrEmpty(PageState.ReturnUrl)) ? PageState.ReturnUrl : NavigateUrl());
    }
}

