With a single card the synthesis is about how its message shows in practice (prompt rule and schema description), and the section is titled 'A gyakorlatban' instead of 'A lapok együtt'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
70 lines
2.2 KiB
TypeScript
70 lines
2.2 KiB
TypeScript
import { tarotCard, type TarotContent, type TarotReading } from "@/lib/tarot";
|
|
|
|
import { Paragraphs, Rich } from "../Rich";
|
|
import { TarotCard } from "./TarotCard";
|
|
|
|
/**
|
|
* A written reading: the title and the gist, each card in its position with
|
|
* its text, how they read together, and the advice.
|
|
*/
|
|
export function TarotResult({
|
|
cards,
|
|
question,
|
|
content,
|
|
}: {
|
|
cards: TarotReading["cards"];
|
|
question: string | null;
|
|
content: TarotContent;
|
|
}) {
|
|
// A single card has nothing to read it with: its synthesis is about everyday life.
|
|
const together = cards.length === 1 ? "A gyakorlatban" : "A lapok együtt";
|
|
return (
|
|
<article className="tarot-result">
|
|
<header className="tarot-result-head">
|
|
<span className="eyebrow">A jóslásod</span>
|
|
<h2>{content.title}</h2>
|
|
{question && <p className="tarot-question">„{question}”</p>}
|
|
<p className="tarot-summary">
|
|
<Rich text={content.summary} />
|
|
</p>
|
|
</header>
|
|
|
|
<ol className="tarot-card-texts">
|
|
{cards.map((c, i) => {
|
|
const card = tarotCard(c.card);
|
|
if (!card) return null;
|
|
return (
|
|
<li key={`${c.card}-${i}`} className="tarot-card-text">
|
|
<TarotCard card={card} reversed={c.reversed} className="tarot-card-sm" />
|
|
<div className="tarot-card-text-body">
|
|
<span className="eyebrow">
|
|
{i + 1}. {c.position}
|
|
</span>
|
|
<h3>
|
|
{card.nameHu}
|
|
{c.reversed && <span className="muted"> · fordított</span>}
|
|
</h3>
|
|
{c.about && <p className="hint">{c.about}</p>}
|
|
<Paragraphs text={content.cards[i]?.body ?? ""} />
|
|
</div>
|
|
</li>
|
|
);
|
|
})}
|
|
</ol>
|
|
|
|
{content.synthesis && (
|
|
<section className="tarot-synthesis" aria-label={together}>
|
|
<h3>{together}</h3>
|
|
<Paragraphs text={content.synthesis} />
|
|
</section>
|
|
)}
|
|
{content.advice && (
|
|
<section className="tarot-advice" aria-label="Útravaló">
|
|
<h3>Útravaló</h3>
|
|
<Paragraphs text={content.advice} />
|
|
</section>
|
|
)}
|
|
</article>
|
|
);
|
|
}
|