Files
sorsfonalak/services/frontend/src/components/AnalysisView.tsx
T
fecoandClaude Opus 5.5 f1bd34c394
CI / test (push) Successful in 56s
CI / build (push) Successful in 4m41s
CI / deploy (push) Skipped
Yearly forecast: solar return, transits, progressions, profection, eclipses
- astro-engine: forecast module (solar return moment, slow-planet transits
  with exact dates and periods, natal house ingresses, secondary
  progressions, annual profection, eclipses via Swiss Ephemeris)
- horoscope-api: POST /v1/forecast, solar return chart cast for the place
  of the birthday
- backend: forecasts table, /v1/charts/{id}/forecasts, /v1/forecasts/{id}
  and its analyses using a new 'forecast' unit; current year of life open,
  the next one 30 days before the birthday
- packages: Páros and Család include forecasts (6 000 / 11 000 Ft),
  +1 éves előrejelzés add-on 2 500 Ft; Egy elemzés unchanged
- worker and prompt: forecast kind with five sections and forecast rules
  (trends, no event predictions); no birth data, place or exact age sent
- frontend: /kepletek/{id}/elorejelzes with the solar return wheel, the
  keys of the year, a monthly timeline, transit list and detailed forecast
- data export: forecasts added, model name removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-18 08:19:13 +00:00

71 lines
2.2 KiB
TypeScript

import type { AnalysisContent } from "@/lib/types";
import { Paragraphs, Rich } from "./Rich";
const NATAL_ORDER = ["personality", "emotions", "mind", "love", "work", "growth"];
const SYNASTRY_ORDER = ["attraction", "communication", "emotional_bond", "friction", "long_term"];
const FORECAST_ORDER = ["theme", "love", "work", "growth", "timeline"];
const ORDER = { natal: NATAL_ORDER, synastry: SYNASTRY_ORDER, forecast: FORECAST_ORDER };
/** A finished detailed analysis (natal, synastry or yearly forecast). */
export function AnalysisView({
content,
kind = "natal",
}: {
content: AnalysisContent;
kind?: "natal" | "synastry" | "forecast";
}) {
const order = ORDER[kind];
const sections = order.map((key) => content.sections?.[key]).filter((s) => s !== undefined);
return (
<article className="analysis">
<header className="analysis-head">
<h2>{content.title}</h2>
{content.summary && (
<p className="analysis-lead">
<Rich text={content.summary} />
</p>
)}
</header>
{sections.map((s, i) => (
<section key={i} className="analysis-section">
<h3>{s.title}</h3>
<Paragraphs text={s.body} />
</section>
))}
<div className="analysis-lists">
{content.strengths && content.strengths.length > 0 && (
<section>
<h3>{kind === "forecast" ? "Lehetőségek" : "Erősségek"}</h3>
<ul>
{content.strengths.map((t, i) => (
<li key={i}>
<Rich text={t} />
</li>
))}
</ul>
</section>
)}
{content.challenges && content.challenges.length > 0 && (
<section>
<h3>Kihívások</h3>
<ul>
{content.challenges.map((t, i) => (
<li key={i}>
<Rich text={t} />
</li>
))}
</ul>
</section>
)}
</div>
{content.advice && (
<section className="analysis-section analysis-advice">
<h3>Útravaló</h3>
<Paragraphs text={content.advice} />
</section>
)}
</article>
);
}