Improved UserLinkComponent

This commit is contained in:
Mia Rose Winter 2024-04-19 21:37:29 +02:00
parent 67d0336ba7
commit 847a543266
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -1,9 +1,10 @@
@using Wave.Data
@using System.Net
@using System.Text.RegularExpressions
<a href="@Link.UrlString" rel="me" target="_blank" title="@Link.Url.Host" @attributes="AdditionalAttributes">
<img src="@("/api/proxy/favicon/" + WebUtility.UrlEncode(Link.Url.Host))" alt="" width="32" height="32" class="w-5 h-5" loading="async" />
@(Link.Url.Host.LastIndexOf('.') > -1 ? Link.Url.Host[..Link.Url.Host.LastIndexOf('.')] : Link.Url.Host)
@Regex.Replace(Link.Url.Host, @"(www\.|.de|.com)", "", RegexOptions.Compiled | RegexOptions.IgnoreCase)
</a>
@code {