import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { TarotLive } from "@/components/tarot/TarotLive"; import { backendGet, requireMe } from "@/lib/server"; import type { TarotReading } from "@/lib/tarot"; export const metadata: Metadata = { title: "Kártyajóslás" }; const day = (iso: string) => new Date(iso).toLocaleDateString("hu-HU", { timeZone: "Europe/Budapest", year: "numeric", month: "long", day: "numeric" }); /** One of the user's readings. */ export default async function TarotReadingPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const me = await requireMe(`/kartyajoslas/${id}`); const reading = await backendGet(`/v1/tarot/readings/${encodeURIComponent(id)}`); if (!reading) notFound(); return (
← Kártyajóslás {reading.topic_name ? `${reading.topic_name} · ` : ""} {reading.spread_name} · {day(reading.created_at)}
); }