Files
dekun fff77dac3f Implement three divination modes, learn pages, and PM2 deploy on port 3130.
Add liuyao/bazi/combined flows with shared calc and AI infrastructure, 64-gua learn routes, and update Ubuntu PM2 deployment docs for port 3130.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 20:19:49 +08:00

73 lines
2.6 KiB
TypeScript
Raw Permalink 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 type { BaziChart, PillarInfo } from "@/lib/calc/bazi";
function PillarRow({ label, pillar }: { label: string; pillar: PillarInfo }) {
return (
<tr className="border-t">
<td className="px-3 py-2 font-medium">{label}</td>
<td className="px-3 py-2 font-mono">{pillar.ganZhi}</td>
<td className="px-3 py-2">{pillar.shiShenGan}</td>
<td className="px-3 py-2 text-sm">
{pillar.shiShenZhi.join("、") || "—"}
</td>
<td className="px-3 py-2 text-sm">{pillar.naYin}</td>
</tr>
);
}
export default function BaziChartDisplay({ chart }: { chart: BaziChart }) {
return (
<div className="space-y-4 rounded-lg border bg-card p-4 text-sm">
<div className="grid gap-1 text-muted-foreground sm:grid-cols-2">
<span>{chart.birthTime}</span>
<span>{chart.trueSolarTime}</span>
<span className="sm:col-span-2">{chart.lunarDate}</span>
</div>
<div className="overflow-x-auto">
<table className="w-full">
<thead className="bg-muted/50 text-left">
<tr>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
</tr>
</thead>
<tbody>
<PillarRow label="年柱" pillar={chart.pillars.year} />
<PillarRow label="月柱" pillar={chart.pillars.month} />
<PillarRow label="日柱" pillar={chart.pillars.day} />
<PillarRow label="时柱" pillar={chart.pillars.time} />
</tbody>
</table>
</div>
<div>
<div className="mb-1 font-medium"></div>
<p className="text-muted-foreground">
{chart.daYun.startYear} {chart.daYun.startMonth} {" "}
{chart.daYun.startDay} ·{" "}
{chart.daYun.items.map((d) => `${d.startAge}${d.ganZhi}`).join(" → ")}
</p>
</div>
<div>
<div className="mb-1 font-medium"></div>
<p className="text-muted-foreground">
{chart.liuNian.map((l) => `${l.year}(${l.ganZhi})`).join("、")}
</p>
</div>
<div>
<div className="mb-1 font-medium"></div>
<p className="text-muted-foreground">
{chart.shenSha.ji.join("、") || "无"}
<br />
{chart.shenSha.xiong.join("、") || "无"}
</p>
</div>
</div>
);
}