- Run the web app and Convex backend in one container with generated per-install keys - Derive Convex URLs from the server address and update self-hosting docs
27 lines
883 B
TypeScript
27 lines
883 B
TypeScript
import { fetchQuery } from "convex/nextjs"
|
|
import { convexServerOptions } from "@/lib/convex-server"
|
|
import { ArtistsView } from "@/components/artists-view"
|
|
import { LibraryLoading } from "@/components/library-loading"
|
|
import { api } from "@otunes/convex/_generated/api"
|
|
|
|
export default async function Page() {
|
|
const [artists, albums] = await Promise.all([
|
|
fetchQuery(api.library.browseArtists, {}, convexServerOptions()),
|
|
fetchQuery(api.library.browseAlbums, {}, convexServerOptions()),
|
|
])
|
|
|
|
return (
|
|
<div className="flex h-svh flex-col">
|
|
<header className="flex items-center gap-2 border-b px-4 py-3">
|
|
<h1 className="text-lg font-semibold">Artists</h1>
|
|
</header>
|
|
|
|
{artists === undefined || albums === undefined ? (
|
|
<LibraryLoading />
|
|
) : (
|
|
<ArtistsView artists={artists} albums={albums} />
|
|
)}
|
|
</div>
|
|
)
|
|
}
|