Own chart back on the Képletem menu; persons get their own menu, page and a tile
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -19,7 +19,7 @@ export function EditPerson({
|
||||
<BirthForm
|
||||
initial={initial}
|
||||
person={{ chartId: id, name }}
|
||||
onCancel={() => router.push("/kepletek")}
|
||||
onCancel={() => router.push("/szemelyek")}
|
||||
onSaved={() => {
|
||||
router.push(`/kepletek/${id}`);
|
||||
router.refresh();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { AspectGrid, AspectList, BigThree, PositionTables } from "@/components/ChartTables";
|
||||
@@ -29,6 +30,7 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
||||
backendGet<{ charts: ChartListItem[] }>("/v1/charts"),
|
||||
]);
|
||||
const charts = chartList?.charts ?? [];
|
||||
const persons = charts.filter((c) => c.kind === "person");
|
||||
if (!chart) notFound();
|
||||
const list = analyses?.analyses ?? [];
|
||||
const summary = list.find((a) => a.kind === "summary" && a.status !== "failed") ?? null;
|
||||
@@ -50,7 +52,7 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
||||
title={chart.is_primary ? "Születési képletem" : chart.label}
|
||||
currentId={chart.id}
|
||||
own={charts.find((c) => c.is_primary) ?? null}
|
||||
persons={charts.filter((c) => c.kind === "person")}
|
||||
persons={persons}
|
||||
canAdd={me.persons.left !== 0}
|
||||
/>
|
||||
<p className="muted">
|
||||
@@ -114,6 +116,22 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{chart.is_primary && (
|
||||
<Link href="/szemelyek" className="card persons-tile">
|
||||
<span className="eyebrow">Személyek</span>
|
||||
<strong>
|
||||
{persons.length > 0 ? `${persons.length} felvett személy` : "Társad, családod képlete"}
|
||||
</strong>
|
||||
<span className="muted">
|
||||
{persons.length > 0
|
||||
? persons.slice(0, 3).map((p) => p.label).join(", ") + (persons.length > 3 ? "…" : "")
|
||||
: "Vedd fel őket, és nézd meg az ő képletüket és elemzésüket is."}
|
||||
</span>
|
||||
<span className="persons-tile-arrow" aria-hidden="true">
|
||||
→
|
||||
</span>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user