2023-09-18 10:55:05 +09:00
|
|
|
@using BTCPayServer.Configuration;
|
|
|
|
@using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|
|
|
@inject IFileVersionProvider FileVersionProvider
|
|
|
|
@inject BTCPayServerOptions BTCPayServerOptions
|
|
|
|
|
|
|
|
<svg role="img" class="icon icon-@Symbol">
|
|
|
|
<use href="@GetPathTo(Symbol)"></use>
|
|
|
|
</svg>
|
|
|
|
@code {
|
2024-09-26 12:10:14 +02:00
|
|
|
[Parameter, EditorRequired]
|
|
|
|
public string Symbol { get; set; }
|
|
|
|
|
|
|
|
private string GetPathTo(string symbol)
|
2023-09-18 10:55:05 +09:00
|
|
|
{
|
|
|
|
var versioned = FileVersionProvider.AddFileVersionToPath(default, "img/icon-sprite.svg");
|
|
|
|
var rootPath = (BTCPayServerOptions.RootPath ?? "/").WithTrailingSlash();
|
2024-09-26 12:10:14 +02:00
|
|
|
return $"{rootPath}{versioned}#{symbol}";
|
2023-09-18 10:55:05 +09:00
|
|
|
}
|
|
|
|
}
|