import type { MonthlyPeriodProseItemUi } from "@/lib/fortune";
import type {
  DaiVanItemView,
  FortuneTone,
  NguyetVanMonthView,
  TuViFortuneViewModel,
} from "@/lib/tuvi-fortune-view-model";
import { TuViDaiVanTimeline } from "./TuViDaiVanTimeline";
import { TuViNguyetVanGrid } from "./TuViNguyetVanGrid";

export type { TuViFortuneViewModel } from "@/lib/tuvi-fortune-view-model";

function tonePillClass(tone: FortuneTone): string {
  if (tone === "good") return "bg-emerald-950/50 text-emerald-100/95 ring-emerald-700/35";
  if (tone === "caution") return "bg-rose-950/45 text-rose-100/92 ring-rose-800/35";
  return "bg-amber-950/40 text-amber-100/90 ring-amber-800/35";
}

function toneBorderClass(tone: FortuneTone): string {
  if (tone === "good") return "border-emerald-800/30";
  if (tone === "caution") return "border-rose-800/30";
  return "border-[#d4af37]/18";
}

const shellClass =
  "rounded-xl border bg-[linear-gradient(165deg,rgba(16,22,38,0.92),rgba(6,8,16,0.96))] p-6 shadow-[inset_0_1px_0_rgba(212,175,55,0.08)] sm:p-8";

type DaiProps = { items: DaiVanItemView[]; onGoLaSo?: () => void };

export function TuViDaiVanPanel({ items, onGoLaSo }: DaiProps) {
  return <TuViDaiVanTimeline items={items} onGoLaSo={onGoLaSo} />;
}

type NguyetProps = { months: NguyetVanMonthView[]; monthlyPeriodProse?: MonthlyPeriodProseItemUi[] | null };

export function TuViNguyetVanPanel({ months, monthlyPeriodProse }: NguyetProps) {
  return <TuViNguyetVanGrid months={months} monthlyPeriodProse={monthlyPeriodProse} />;
}

export { TuViNhatVanPanel } from "./TuViNhatVanPanel";
