38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import type { Metadata } from "next";
|
|||
|
|
import Link from "next/link";
|
||
|
|
|
||
|
|
import { TarotTable } from "@/components/tarot/TarotTable";
|
||
|
|
import { payMethod } from "@/lib/payments";
|
||
|
|
import { backendGet, requireMe } from "@/lib/server";
|
||
|
|
import type { TarotReading } from "@/lib/tarot";
|
||
|
|
import type { PublicConfig } from "@/lib/types";
|
||
|
|
|
||
|
|
export const metadata: Metadata = { title: "Kártyajóslás" };
|
||
|
|
|
||
|
|
/** Tarot readings written for the user's own question. */
|
||
|
|
export default async function TarotPage() {
|
||
|
|
const me = await requireMe("/kartyajoslas");
|
||
|
|
const [data, config] = await Promise.all([
|
||
|
|
backendGet<{ readings: TarotReading[]; left: number }>("/v1/tarot/readings"),
|
||
|
|
backendGet<PublicConfig>("/v1/config"),
|
||
|
|
]);
|
||
|
|
return (
|
||
|
|
<main className="page" style={{ maxWidth: 1040 }}>
|
||
|
|
<div className="page-head">
|
||
|
|
<span className="eyebrow">Tarot</span>
|
||
|
|
<h1>Kártyajóslás</h1>
|
||
|
|
<p className="muted">
|
||
|
|
Kérdezz, húzz lapot, és a kirakásod alapján személyre szabott jóslást kapsz. A lapok értelmezéséhez a képleted
|
||
|
|
Napja, Holdja és Aszcendense is hozzájárul. <Link href="/kartyajoslas/pelda">Példajóslás →</Link>
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<TarotTable
|
||
|
|
readings={data?.readings ?? []}
|
||
|
|
left={data?.left ?? me.analyses_left.tarot ?? 0}
|
||
|
|
isAdmin={me.user.roles.includes("admin")}
|
||
|
|
canPay={payMethod(config, me)}
|
||
|
|
/>
|
||
|
|
</main>
|
||
|
|
);
|
||
|
|
}
|