@page "/settings"
@using Website.Client.Pages.User.SettingsPage.Components


<Title Value="Settings - Unturned Store"></Title>

<Meta name="description" content="Marketplace of products for Unturned" />
<Meta property="og:title" content="Settings" />


<Meta property="og:image" content="/img/logo.png" />
<Meta property="og:image:width" content="128" />
<Meta property="og:image:height" content="128" />
<Meta property="og:description" content="Marketplace of products for Unturned" />


@if (User != null)
{
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item active" aria-current="page">Settings</li>
        </ol>
    </nav>

    <div class="row">
        <div class="col-md-3">
            <div class="list-group">
                <div class="list-group-item fw-bold">Account Settings</div>
                <a href="javascript:void(0)" @onclick="() => ChangeTab(ESettingsTab.Profile)" class="list-group-item list-group-item-action @LoadingClass() @TabClass(ESettingsTab.Profile)">
                    Profile
                </a>
                <AuthorizeView Roles="@RoleConstants.AdminAndSeller">
                    <Authorized>
                        <a href="javascript:void(0)" @onclick="() => ChangeTab(ESettingsTab.Seller)" class="list-group-item list-group-item-action @LoadingClass() @TabClass(ESettingsTab.Seller)">
                            Seller
                        </a>
                    </Authorized>                    
                </AuthorizeView>
                
                <a href="javascript:void(0)" @onclick="() => ChangeTab(ESettingsTab.Notifications)" class="list-group-item list-group-item-action @LoadingClass() @TabClass(ESettingsTab.Notifications)">
                    Notifications
                </a>
            </div>
        </div>
        <div class="col-md-9">
            <div class="bg-light p-3 rounded-3">
                @if (currentTab == ESettingsTab.Profile)
                {
                    <ProfileTab User="User" @bind-IsLoading="isLoading" />
                }
                else if (currentTab == ESettingsTab.Seller)
                {
                    <SellerTab User="User" @bind-IsLoading="isLoading" />
                }
                else if (currentTab == ESettingsTab.Notifications)
                {
                    <NotificationsTab User="User" @bind-IsLoading="isLoading" />                    
                }

            </div>
        </div>
    </div>

    
}