"use client"; import { SIGN_LABELS, TIER_LABELS, type SegmentSummary } from "@/lib/rectification-agentic/core/segment-summary"; import type { RangeDeliveryProjection } from "@/lib/rectification-agentic/v9/divergence-panel"; import { RECTIFICATION_USER_COPY, REPRESENTATIVE_MINUTE_DISCLAIMER } from "@/lib/rectification-agentic/user-copy"; import { SWITCH_TO_RECTIFIED_LABEL } from "@/lib/rectification-agentic/birth-time-provenance"; import { RectificationVerificationReport } from "@/components/rectification-verification-report"; import { protectVargaReport } from "@/lib/rectification-agentic/v9/delivery-window"; import { unknownProductDeliveryCopy } from "@/lib/rectification-agentic/v9/product-delivery"; export function RectificationSegmentDelivery({ summary, delivery, rangeLabel, selection, resultId, busy, accepting, onAccept, adoptLocked, markdown, candidateDate, canAdopt = false }: Readonly<{ summary: SegmentSummary | null; delivery: RangeDeliveryProjection; rangeLabel: string | null; selection?: Readonly<{ resultId: string; candidateId: string; date: string; time: string; contract: "segment-v1" }> | null; resultId: string; busy: boolean; accepting: boolean; onAccept: (candidateId: string) => void; adoptLocked?: boolean; markdown?: string | null; candidateDate?: string; canAdopt?: boolean; }>) { const adoption = summary?.adoption_minute; const candidateId = delivery.representative_candidate_id; const exactAdoption = Boolean(adoption?.date && selection?.contract === "segment-v1" && selection.resultId === resultId && selection.candidateId === candidateId && selection.date === adoption.date && selection.time === adoption.time); // BUG-1173: a post-adopt answer can move the server's adoption minute. Only when the adopted // minute left the verdict (server `readopt_minute`) does the button come back, as 「改用 HH:MM」. const readopt = delivery.readopt_minute ?? null; const priorAdoption = selection?.contract === "segment-v1" && selection.resultId === resultId ? selection : null; const adopted = exactAdoption || Boolean(priorAdoption && !readopt); const charts = summary?.charts.filter((chart) => chart.tier !== "blocked") ?? []; const blocked = summary?.charts.some((chart) => chart.tier === "blocked") === true; const reportBlocked = !summary || blocked; const showAdopt = Boolean(canAdopt && adoption && candidateId && !adoptLocked); return (
用哪张盘解读
{blocked ?

分盘解读需要更准的出生时间

: null} {rangeLabel ?

分钟范围 {rangeLabel}

: null} {!summary && delivery.product_delivery ?

{unknownProductDeliveryCopy(delivery.product_delivery)}

: null} {summary && !summary.scan_complete ?

完整窗口扫描暂不可用;候选盘型不能证明全窗一致。{candidateDate ? `候选代表日期 ${candidateDate};原填报日期保留。` : ""}

: null} {adoptLocked ?

{RECTIFICATION_USER_COPY.rangeDeliveryAdoptLocked}

: null} {delivery.provenance_line ?

{delivery.provenance_line}

: null} {showAdopt && adoption && candidateId ? ( <>

采用后按 {adoption.date ? `${adoption.date} ` : ""}{adoption.time} 排盘;原填报资料保留。

{readopt && priorAdoption && !adopted ? (

现在按 {priorAdoption.time} 排盘;改用后按 {readopt} 排盘,原填报资料保留。

) : null} {delivery.record_conflict && !adopted ? (

选它之后,排盘会从出生记录时间 {delivery.record_conflict.reported_time} 换成 {adoption.date ? `${adoption.date} ` : ""}{adoption.time}。

) : null} ) : adopted ? (

{RECTIFICATION_USER_COPY.rangeDeliveryAdopted}

) : null}

{delivery.boundary || REPRESENTATIVE_MINUTE_DISCLAIMER}

); }