- Replace mobile placeholder with Expo Router app (tabs, playback, auth, library) - Move Convex backend to @otunes/convex for web and mobile reuse - Update web app imports and API routes to use shared package
68 lines
1.6 KiB
TypeScript
68 lines
1.6 KiB
TypeScript
import Link from "next/link"
|
|
|
|
import type { BrowseSong } from "@otunes/convex/types"
|
|
import { cn } from "@/lib/utils"
|
|
|
|
export function PlaybackSongMeta({
|
|
song,
|
|
isCurrent = false,
|
|
inRange = false,
|
|
align = "center",
|
|
showAlbum = true,
|
|
}: {
|
|
song: BrowseSong
|
|
isCurrent?: boolean
|
|
inRange?: boolean
|
|
align?: "center" | "start"
|
|
showAlbum?: boolean
|
|
}) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"min-w-0",
|
|
align === "center" ? "max-w-48 text-center sm:max-w-64" : "flex-1"
|
|
)}
|
|
>
|
|
<Link
|
|
href={`/album/${song.album.id}`}
|
|
className={cn(
|
|
"block truncate text-sm font-medium hover:underline",
|
|
inRange && "text-primary-foreground hover:text-primary-foreground/80",
|
|
isCurrent && !inRange && "text-primary"
|
|
)}
|
|
>
|
|
{song.title}
|
|
</Link>
|
|
<p
|
|
className={cn(
|
|
"truncate text-xs",
|
|
inRange ? "text-primary-foreground/80" : "text-muted-foreground"
|
|
)}
|
|
>
|
|
<Link
|
|
href={`/artist/${song.artist.id}`}
|
|
className={cn(
|
|
"hover:underline",
|
|
inRange
|
|
? "text-primary-foreground/80 hover:text-primary-foreground"
|
|
: "hover:text-foreground"
|
|
)}
|
|
>
|
|
{song.artist.name}
|
|
</Link>
|
|
{showAlbum ? (
|
|
<>
|
|
<span aria-hidden="true"> — </span>
|
|
<Link
|
|
href={`/album/${song.album.id}`}
|
|
className="hover:text-foreground hover:underline"
|
|
>
|
|
{song.album.title}
|
|
</Link>
|
|
</>
|
|
) : null}
|
|
</p>
|
|
</div>
|
|
)
|
|
}
|