Files
sorsfonalak/services/frontend/src/components/ChartCard.tsx
T
fecoandClaude Opus 5.5 fef1605848
CI / test (push) Failing after 43s
CI / build (push) Skipped
CI / deploy (push) Skipped
Persons: other people's charts with package slots, list page, switcher
- charts.kind own/person; a new person uses a 'person' unit (not refunded
  on delete); person packages and an unlimited entitlement; admins unlimited
- a person's birth data can be corrected within an hour (admins any time)
- /kepletek list with tiles, /kepletek/uj, correction page, mock person
  packages, chart page title switches between charts keeping the tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-17 11:03:55 +00:00

44 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Link from "next/link";
import { SIGNS, formatBirthDate } from "@/lib/astro";
import type { ChartListItem } from "@/lib/types";
/** Sun, Moon and Ascendant sign glyphs of a chart. */
export function SignTrio({ chart }: { chart: ChartListItem }) {
const h = chart.highlights;
const items: [string, string | null][] = [
["☉", h.sun],
["☽", h.moon],
["AC", h.time_known ? h.ascendant : null],
];
return (
<span className="sign-trio" aria-hidden="true">
{items.map(([k, sign]) => (
<span key={k}>
<span className={k === "AC" ? "trio-ac" : "sym"}>{k}</span>
<span className="sym trio-sign">{sign ? SIGNS[sign]?.glyph : "–"}</span>
</span>
))}
</span>
);
}
/** One chart in the list: name, birth date and place, the three main signs. */
export function ChartCard({ chart, title, children }: { chart: ChartListItem; title: string; children?: React.ReactNode }) {
const { birth } = chart;
return (
<div className="chart-card">
<Link href={`/kepletek/${chart.id}`} className="chart-card-link">
<strong className="chart-card-name">{title}</strong>
<span className="muted">
{formatBirthDate(birth.date)}
{birth.time ? `, ${birth.time.slice(0, 5)}` : ""}
{birth.place ? ` · ${birth.place}` : ""}
</span>
<SignTrio chart={chart} />
</Link>
{children}
</div>
);
}