@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
@using Dynamicweb.Content

@{ 
	if (Model.Item.TryGetString("ComponentSource", out string componentId)) 
	{
		var componentPage = Dynamicweb.Content.Services.Pages.GetPageOrLanguage(Dynamicweb.Core.Converter.ToInt32(componentId), Pageview.AreaID);
		if (componentPage is not null) 
		{
			@RenderGrid(componentPage.ID);
		}
		else if (Pageview.IsVisualEditorMode) 
		{ 
			<div class="alert alert-dark m-0" role="alert">
				<span>@Translate("The selected component does not exist anymore")</span>
			</div>
		}
	}
	else if (Pageview.IsVisualEditorMode) 
	{ 
		<div class="alert alert-dark m-0" role="alert">
			<span>@Translate("Product component: The component will be shown here, if any")</span>
		</div>
	}
}
