/osszevetesek compares any two of the user's charts (own and persons); the person card and the person's chart page have "Összevetés velem". The comparison page shows a double wheel (first person inside with houses, second outside, aspects between them), the aspects by character, and tabs: paid relationship analysis (synastry unit), the cross aspect grid, house overlays, composite and the full aspect list. Correcting a person within the hour now deletes the user's own comparisons with them instead of being refused; still refused after a paid analysis or when someone else's comparison uses the chart. The relationship analysis prompt is editable on /admin/promptok too, and can be tried on one of the admin's comparisons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
72 lines
3.0 KiB
TypeScript
72 lines
3.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import Link from "next/link";
|
|
|
|
import { formatDate } from "@/lib/astro";
|
|
import { backendGet, requireMe } from "@/lib/server";
|
|
import { listName } from "@/lib/synastry";
|
|
import type { ChartListItem, SynastryListItem } from "@/lib/types";
|
|
|
|
import { ComparisonActions } from "./ComparisonActions";
|
|
import { NewComparison } from "./NewComparison";
|
|
|
|
export const metadata: Metadata = { title: "Összevetések" };
|
|
|
|
/** The user's comparisons, and a form for a new one. */
|
|
export default async function ComparisonsPage() {
|
|
await requireMe("/osszevetesek");
|
|
const [chartList, synastryList] = await Promise.all([
|
|
backendGet<{ charts: ChartListItem[] }>("/v1/charts"),
|
|
backendGet<{ synastries: SynastryListItem[] }>("/v1/synastries"),
|
|
]);
|
|
const charts = chartList?.charts ?? [];
|
|
const synastries = synastryList?.synastries ?? [];
|
|
|
|
return (
|
|
<main className="page" style={{ maxWidth: 1080 }}>
|
|
<div className="page-head">
|
|
<h1>Összevetések</h1>
|
|
<p className="muted">
|
|
Két képlet egymásra vetítve: mi vonz, hol súrlódtok, és mit ad a kapcsolat. A saját és a felvett személyek
|
|
képletei közül bármelyik kettőt összevetheted.
|
|
</p>
|
|
</div>
|
|
|
|
<NewComparison charts={charts} />
|
|
|
|
{synastries.length > 0 && (
|
|
<section className="field" aria-labelledby="list-title" style={{ gap: 12 }}>
|
|
<h2 id="list-title">Korábbi összevetések</h2>
|
|
<div className="chart-cards">
|
|
{synastries.map((s) => {
|
|
const name = `${listName(s.chart1, charts)} és ${listName(s.chart2, charts)}`;
|
|
const n = s.summary?.by_nature;
|
|
const total = s.summary?.aspect_count || 1;
|
|
return (
|
|
<div key={s.id} className="chart-card">
|
|
<Link href={`/osszevetesek/${s.id}`} className="chart-card-link">
|
|
<strong className="chart-card-name">{name}</strong>
|
|
<span className="muted">{formatDate(s.created_at)}</span>
|
|
{n && (
|
|
<>
|
|
<span className="nature-bar nature-bar-sm" aria-hidden="true">
|
|
<span className="nature-seg nature-harmonious" style={{ flexGrow: n.harmonious / total }} />
|
|
<span className="nature-seg nature-challenging" style={{ flexGrow: n.challenging / total }} />
|
|
<span className="nature-seg nature-neutral" style={{ flexGrow: n.neutral / total }} />
|
|
</span>
|
|
<span className="hint">
|
|
{n.harmonious} harmonikus · {n.challenging} feszültebb · {n.neutral} együttállás
|
|
</span>
|
|
</>
|
|
)}
|
|
</Link>
|
|
{s.owned && <ComparisonActions id={s.id} name={name} />}
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
</section>
|
|
)}
|
|
</main>
|
|
);
|
|
}
|