@using BTCPayServer.Abstractions.Contracts
@using BTCPayServer.Client
@using BTCPayServer.Plugins.Wabisabi
@inject IScopeProvider ScopeProvider
@{
    var storeId = ScopeProvider.GetCurrentStoreId();
    var isActive = !string.IsNullOrEmpty(storeId) && ViewContext.RouteData.Values.TryGetValue("Controller", out var controller) &&  controller is not null && 
        nameof(WabisabiStoreController).StartsWith(controller?.ToString(), StringComparison.InvariantCultureIgnoreCase);
}
@if (!string.IsNullOrEmpty(storeId))
{
    <li class="nav-item" permission="@Policies.CanModifyStoreSettings">
        <a asp-area="" asp-controller="WabisabiStore" asp-action="UpdateWabisabiStoreSettings" asp-route-storeId="@storeId" class="nav-link js-scroll-trigger @(isActive? "active": string.Empty)">
            <svg xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 24 24" class="icon" style="height: 14px;"> 
                <path fill="currentColor" d="M12 4.942c1.827 1.105 3.474 1.6 5 1.833v7.76c0 1.606-.415 1.935-5 4.76v-14.353zm9-1.942v11.535c0 4.603-3.203 5.804-9 9.465-5.797-3.661-9-4.862-9-9.465v-11.535c3.516 0 5.629-.134 9-3 3.371 2.866 5.484 3 9 3zm-2 1.96c-2.446-.124-4.5-.611-7-2.416-2.5 1.805-4.554 2.292-7 2.416v9.575c0 3.042 1.69 3.83 7 7.107 5.313-3.281 7-4.065 7-7.107v-9.575z"/></svg>
            <span>Coinjoin</span>
        </a>
    </li>
}
