feat(web): rework preview page onto tabs + covers + album modal
The standalone /discover/artist/[mbid] preview page was an inconsistent orphan (no art, no tabs, old inline TRACKS toggle). Rebuild it to mirror the artist-detail page: category tabs, cover thumbnails, and the album modal for tracks, with per-release Want. Extract shared categoryOf/TAB_ORDER util. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export type Category = "Albums" | "Singles" | "EPs" | "Live" | "Comps" | "Other";
|
||||
|
||||
export const TAB_ORDER: Category[] = ["Albums", "Singles", "EPs", "Live", "Comps", "Other"];
|
||||
|
||||
/** Bucket a release-group into a discography category, for the artist-detail + preview tabs. */
|
||||
export function categoryOf(r: { primaryType: string | null; secondaryTypes: string[] }): Category {
|
||||
if (r.secondaryTypes.includes("Live")) return "Live";
|
||||
if (r.secondaryTypes.includes("Compilation")) return "Comps";
|
||||
if (r.secondaryTypes.length > 0) return "Other";
|
||||
if (r.primaryType === "Album") return "Albums";
|
||||
if (r.primaryType === "Single") return "Singles";
|
||||
if (r.primaryType === "EP") return "EPs";
|
||||
return "Other";
|
||||
}
|
||||
Reference in New Issue
Block a user