@using TightWiki.Models
@model TightWiki.Models.ViewModels.Admin.MenuItemViewModel
@{
    Layout = "/Views/Shared/_Layout.cshtml";
    var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
}


@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
    <div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
}
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
{
    <div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
}

@if (string.IsNullOrEmpty(Model.ErrorMessage))
{
    <div class="card border-danger mb-3">
        <div class="card-header bg-danger text-white">
            <strong>Delete menu item "@Model.Name"?</strong>
        </div>
        <div class="card-body">
            Deleting "@Model.Name" will permanently remove the menu item.
            <strong>You will not be able to revert this action.</strong>
            <br /><br />

            Are you sure you want to continue with this deletion?<br /><br />

            @using (Html.BeginForm(null, null, FormMethod.Post, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
            {
                <div class="form-group"><button type="submit" class="btn btn-danger rounded-0" name="IsActionConfirmed" value="true">Yes</button>&nbsp;&nbsp;<button type="submit" class="btn btn-success rounded-0" name="IsActionConfirmed" value="false">No</button></div>
            }
        </div>
    </div>
}
