import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { ChartWheel, WheelLegend } from "@/components/ChartWheel"; import { Rich } from "@/components/Rich"; import { ShareVisit } from "@/components/ShareVisit"; import { PublicHeader } from "@/components/SiteHeader"; import { SIGNS, signName } from "@/lib/astro"; import { getMe } from "@/lib/server"; import { bigThree, imageVersion, loadShare, plain, shorten, siteUrl } from "@/lib/share"; type Props = { params: Promise<{ slug: string }> }; /** Title, description and preview image for Facebook, Messenger, WhatsApp and co. */ export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const share = await loadShare(slug); if (!share?.chart) return { title: "A link nem érhető el", robots: { index: false } }; const base = await siteUrl(); const title = share.summary?.title ?? "Születési képlet"; const description = share.summary?.summary ? shorten(plain(share.summary.summary), 200) : "Egy születési képlet a Sorsfonalakon."; const url = `${base}/s/${slug}`; const image = { url: `${base}/s/${slug}/kep/${imageVersion(share)}.png`, width: 1200, height: 630, alt: title }; return { title, description, // Personal content: shown when shared, not listed in search engines. robots: { index: false, follow: false }, alternates: { canonical: url }, openGraph: { type: "website", siteName: "Sorsfonalak", locale: "hu_HU", url, title, description, images: [image] }, twitter: { card: "summary_large_image", title, description, images: [image.url] }, }; } /** A shared chart: the wheel and its short summary, open to anyone with the link. */ export default async function SharedChartPage({ params }: Props) { const { slug } = await params; const [share, me] = await Promise.all([loadShare(slug), getMe()]); const chart = share?.chart?.chart; if (!share || !chart) notFound(); const summary = share.summary; const trio = bigThree(chart); return ( <> {!me && ( )}
Megosztott születési képlet

{summary?.title ?? "Születési képlet"}

Röviden {summary?.summary ? (

) : (

Ehhez a képlethez még nincs rövid összefoglaló.

)} {trio.length > 0 && (

{trio.map((t) => ( {" "} {t.label} {signName(t.sign)} ))}

)} {!chart.time_known && (

A születési idő nem ismert, ezért a képleten nincsenek házak és Aszcendens.

)}

És a te képleted mit mutat?

Add meg a születési adataidat, és megkapod a saját képletedet a rövid összefoglalóval együtt, ingyen.

{me ? "A saját képletem" : "Elkészítem a sajátomat"}

Ezt a képletet a tulajdonosa osztotta meg, név és születési adatok nélkül. A szöveget mesterséges intelligencia írta a képlet alapján.

); }