@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.Navigation.NavigationTreeViewModel>

@if (!Pageview.IsVisualEditorMode || Model.Nodes.Any())
{
	string foregroundColor = Model?.Parameters["ForegroundColor"] != null ? Model.Parameters["ForegroundColor"].ToString() : "";
	string backgroundColor = Model?.Parameters["BackgroundColor"] != null ? Model.Parameters["BackgroundColor"].ToString() : "transparent";
	var uri = Dynamicweb.Context.Current.Request.Url;
	var hostname = uri.Scheme + Uri.SchemeDelimiter + uri.Host;

	foreach (var node in Model.Nodes)
	{
		<text>
			<!--[if !mso]-->
			<a style="display: inline-block;font-size: 14px;font-weight: bold;line-height: 24px;padding: 12px 24px;text-align: center;text-decoration: none !important;transition: opacity 0.1s ease-in;color: @foregroundColor !important;background-color: @backgroundColor;" href="@node.Link">
				@node.Name
			</a>
			<!--[endif]-->
			<!--[if mso]>
				<v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="@hostname/@node.Link" style="height:50px;v-text-anchor:middle;width:120px;" fillcolor="@backgroundColor" stroke="f">
					<w:anchorlock/>
					<v:textbox style="mso-fit-shape-to-text:t" inset="12px,12px,12px,12px">
						<center style="font-size:14px;color:@foregroundColor;background-color:@backgroundColor">
							@node.Name
						</center>
					</v:textbox>
				</v:rect>
			<![endif]-->
		</text>
	}
}
else if (!Model.Nodes.Any())
{
	<div class="alert alert-dark m-0" role="alert">
		<span>@Translate("Breadcrumb navigation: The navigation will be shown here, if any")</span>
	</div>
}
