@namespace DeepDrftPublic.Client.Controls @* Shared background-image hero with all release metadata overlaid: top row (genre/date + share), bottom row (optional cover thumb + title/artist + play). Single source of truth for the overlay composition consumed by both Session and Mix detail. Purely presentational — owns no data fetch and no player wiring; play/share ride in as slots so each page keeps its own toggle. Per-page aspect/sizing variance rides the Class parameter (e.g. Mix's square `mix-hero`), never a fork. *@ @{ var hasGenre = !string.IsNullOrEmpty(Genre); var hasDate = ReleaseDate is not null; // Show the cover thumbnail only when it differs from the hero background — otherwise it would // duplicate the same image. Mix passes CoverThumbKey=null, so this is false there for free. var showCover = !string.IsNullOrEmpty(CoverThumbKey) && CoverThumbKey != HeroImageKey; } @* The hero is the positioning context for every overlay row; the gradient shim and the top/bottom overlays are absolutely positioned children of this wrapper. *@
@if (!string.IsNullOrEmpty(HeroImageKey)) {
} else {
} @* Darkening shim so overlaid text/controls stay legible over any image. *@
@* Top overlay: secondary details (genre, release date) and the share affordance. *@
@if (hasGenre) { @Genre } @if (hasDate) {
Released @ReleaseDate!.Value.ToString("MMMM yyyy")
}
@if (ShareContent is not null) {
@ShareContent
}
@* Bottom overlay: cover thumbnail, title/artist, and the play affordance in one row. *@
@if (showCover) {
}
@Title
@Artist
@if (PlayContent is not null) {
@PlayContent
}
@code { /// Background image entry key. Null renders the placeholder treatment. [Parameter] public string? HeroImageKey { get; set; } /// Material icon for the no-image placeholder (Session: Piano; Mix: Album). [Parameter] public required string PlaceholderIcon { get; set; } /// /// Optional small cover thumbnail in the bottom row. Shown only when it differs from /// (otherwise it would duplicate the background). Mix passes null. /// [Parameter] public string? CoverThumbKey { get; set; } [Parameter] public required string Title { get; set; } [Parameter] public string? Artist { get; set; } [Parameter] public string? Genre { get; set; } [Parameter] public DateOnly? ReleaseDate { get; set; } /// Share affordance slot — each page passes its own SharePopover with the right params. [Parameter] public RenderFragment? ShareContent { get; set; } /// Play affordance slot — each page passes its PlayStateIcon wired to its own toggle. [Parameter] public RenderFragment? PlayContent { get; set; } /// Extra class for per-page aspect/sizing variance (e.g. Mix's square `mix-hero`). [Parameter] public string? Class { get; set; } }