141 lines
4.9 KiB
TypeScript
141 lines
4.9 KiB
TypeScript
import { ANGLES, POINTS, SIGNS, dms, signName } from "@/lib/astro";
|
||||
|
|
import type { Chart, Position } from "@/lib/types";
|
|||
|
|
|
|||
|
|
function Pos({ p }: { p: Position }) {
|
|||
|
|
return (
|
|||
|
|
<>
|
|||
|
|
{dms(p.degree_in_sign_dms)} <span className="sym">{SIGNS[p.sign]?.glyph}</span> {signName(p.sign)}
|
|||
|
|
</>
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/** The big three and the positions of a natal chart. */
|
|||
|
|
export function ChartTables({ chart }: { chart: Chart }) {
|
|||
|
|
const result = chart.chart;
|
|||
|
|
const timeKnown = chart.highlights.time_known;
|
|||
|
|
const angles = ANGLES.map(([key, label]) => [label, result.angles[key]] as const).filter(
|
|||
|
|
(a): a is readonly [string, Position] => typeof a[1] === "object" && a[1] !== null,
|
|||
|
|
);
|
|||
|
|
const fortune = result.lots?.fortune;
|
|||
|
|
const sun = result.points.find((p) => p.id === "sun");
|
|||
|
|
const moon = result.points.find((p) => p.id === "moon");
|
|||
|
|
|
|||
|
|
return (
|
|||
|
|
<div className="field" style={{ gap: 24 }}>
|
|||
|
|
<div className="big3">
|
|||
|
|
<div>
|
|||
|
|
<span className="muted">Nap</span>
|
|||
|
|
<span className="glyph sym">{SIGNS[chart.highlights.sun ?? ""]?.glyph}</span>
|
|||
|
|
<strong>{signName(chart.highlights.sun)}</strong>
|
|||
|
|
{sun && <span className="muted num">{dms(sun.degree_in_sign_dms)}</span>}
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<span className="muted">Hold{!timeKnown && " (közelítő)"}</span>
|
|||
|
|
<span className="glyph sym">{SIGNS[chart.highlights.moon ?? ""]?.glyph}</span>
|
|||
|
|
<strong>{signName(chart.highlights.moon)}</strong>
|
|||
|
|
{moon && <span className="muted num">{dms(moon.degree_in_sign_dms)}</span>}
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<span className="muted">Aszcendens</span>
|
|||
|
|
{timeKnown ? (
|
|||
|
|
<>
|
|||
|
|
<span className="glyph sym">{SIGNS[chart.highlights.ascendant ?? ""]?.glyph}</span>
|
|||
|
|
<strong>{signName(chart.highlights.ascendant)}</strong>
|
|||
|
|
</>
|
|||
|
|
) : (
|
|||
|
|
<strong className="muted">–</strong>
|
|||
|
|
)}
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div className="grid-2" style={{ alignItems: "start" }}>
|
|||
|
|
<div className="table-wrap">
|
|||
|
|
<h3 style={{ marginBottom: 8 }}>Bolygók és pontok</h3>
|
|||
|
|
<table>
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th scope="col">Pont</th>
|
|||
|
|
<th scope="col">Pozíció</th>
|
|||
|
|
{timeKnown && <th scope="col">Ház</th>}
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
{result.points.map((p) => (
|
|||
|
|
<tr key={p.id}>
|
|||
|
|
<td>
|
|||
|
|
<span className="sym" aria-hidden="true">
|
|||
|
|
{POINTS[p.id]?.glyph}
|
|||
|
|
</span>{" "}
|
|||
|
|
{POINTS[p.id]?.hu ?? p.id}
|
|||
|
|
{p.retrograde && (
|
|||
|
|
<abbr className="retro" title="retrográd">
|
|||
|
|
R
|
|||
|
|
</abbr>
|
|||
|
|
)}
|
|||
|
|
</td>
|
|||
|
|
<td className="num">
|
|||
|
|
<Pos p={p} />
|
|||
|
|
</td>
|
|||
|
|
{timeKnown && <td className="num">{p.house ? `${p.house}.` : "–"}</td>}
|
|||
|
|
</tr>
|
|||
|
|
))}
|
|||
|
|
{timeKnown && fortune && (
|
|||
|
|
<tr>
|
|||
|
|
<td>Szerencsepont</td>
|
|||
|
|
<td className="num">
|
|||
|
|
<Pos p={fortune} />
|
|||
|
|
</td>
|
|||
|
|
<td className="num">{fortune.house ? `${fortune.house}.` : "–"}</td>
|
|||
|
|
</tr>
|
|||
|
|
)}
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
{timeKnown && (
|
|||
|
|
<div className="field" style={{ gap: 24 }}>
|
|||
|
|
<div className="table-wrap">
|
|||
|
|
<h3 style={{ marginBottom: 8 }}>Tengelyek</h3>
|
|||
|
|
<table>
|
|||
|
|
<tbody>
|
|||
|
|
{angles.map(([label, p]) => (
|
|||
|
|
<tr key={label}>
|
|||
|
|
<td>{label}</td>
|
|||
|
|
<td className="num">
|
|||
|
|
<Pos p={p} />
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
))}
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
{result.houses && (
|
|||
|
|
<div className="table-wrap">
|
|||
|
|
<h3 style={{ marginBottom: 8 }}>Házcsúcsok (Placidus)</h3>
|
|||
|
|
<table>
|
|||
|
|
<tbody>
|
|||
|
|
{result.houses.cusps.map((c) => (
|
|||
|
|
<tr key={c.house}>
|
|||
|
|
<td>{c.house}. ház</td>
|
|||
|
|
<td className="num">
|
|||
|
|
<Pos p={c} />
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
))}
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
)}
|
|||
|
|
</div>
|
|||
|
|
)}
|
|||
|
|
</div>
|
|||
|
|
{!timeKnown && (
|
|||
|
|
<p className="hint">
|
|||
|
|
Születési idő nélkül a házak, a tengelyek és az Aszcendens nem számolhatók; a Hold helyzete a nap folyamán akár
|
|||
|
|
jegyet is válthat, ezért közelítő.
|
|||
|
|
</p>
|
|||
|
|
)}
|
|||
|
|
</div>
|
|||
|
|
);
|
|||
|
|
}
|