@using Wave.Data
@using System.Globalization

<ArticleLink Article="Article">
	<article class="card card-compact min-h-56 bg-base-200 text-base-content rounded-md shadow h-full">
		<div class="card-body max-h-full">
			<div class="fade-away h-full">
				<h3 class="card-title line-clamp-2 min-h-[2.8em]">@Article.Title</h3>
				<p class="flex-1 overflow-hidden hyphens-auto text-justify" lang="@CultureInfo.CurrentCulture">
					<small>@Article.Author.Name</small>
					<small class="text-sm">@Article.PublishDate.ToString("d")</small>
					<br>

					@((MarkupString) Article.BodyPlain[..Math.Min(500, Article.BodyPlain.Length)]) ...
				</p>
			</div>
		</div>
	</article>
</ArticleLink>

@code {
    [Parameter]
    public required Article Article { get; set; }


}
