@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" />
	@Regex.Replace(Link.Url.Host, @"(www\.|.de|.com)", "", RegexOptions.Compiled | RegexOptions.IgnoreCase)
</a>

@code {
	[Parameter]
	public required UserLink Link { get; set; }
    [Parameter(CaptureUnmatchedValues = true)]
    public IDictionary<string, object>? AdditionalAttributes { get; set; }
}
