"use client"; import type { RectificationCandidateResult } from "@/lib/rectification-candidate-result"; import { RECTIFICATION_USER_COPY, REPRESENTATIVE_MINUTE_DISCLAIMER, rangeDeliveryEventCopy, } from "@/lib/rectification-agentic/user-copy"; import type { RangeDeliveryProjection } from "@/lib/rectification-agentic/v9/divergence-panel"; import { SWITCH_TO_RECTIFIED_LABEL, switchToRectifiedConfirmCopy, } from "@/lib/rectification-agentic/birth-time-provenance"; import { RectificationVerificationReport } from "@/components/rectification-verification-report"; function columnHasTraits(column: RangeDeliveryProjection["columns"][number]): boolean { return Boolean(column.traits.d9 || column.traits.d10 || column.traits.nakshatra.length > 0); } export function RectificationRangeDelivery({ result, acceptingCandidateId, readonly, onAccept, adoptLocked, }: Readonly<{ result: RectificationCandidateResult; acceptingCandidateId: string | null; readonly: boolean; onAccept: (candidateId: string) => void; adoptLocked?: boolean; }>) { const delivery: RangeDeliveryProjection | null = result.rangeDelivery; const range = delivery?.range ?? result.credibleRange; const eventCount = delivery?.event_count ?? 0; const selected = result.selectedTime; const busy = Boolean(acceptingCandidateId) || readonly || adoptLocked; const columns = delivery?.columns ?? []; const title = range ? eventCount > 0 ? `${RECTIFICATION_USER_COPY.rangeDeliveryTitle} ${range[0]}–${range[1]}(${rangeDeliveryEventCopy(eventCount)})` : `${RECTIFICATION_USER_COPY.rangeDeliveryTitle} ${range[0]}–${range[1]}` : RECTIFICATION_USER_COPY.rangeDeliveryTitle; const markdown = delivery?.verification_markdown ?? result.verificationReportMarkdown; const sharedTraits = delivery?.shared_traits ?? []; // BUG-691: while the birth record disagrees with the range the adopt entry says what // it actually does — swap the charting clock — instead of the neutral 「更像这个」. const recordConflict = delivery?.record_conflict ?? null; const caption = delivery?.narrow_hint ?? null; return (
{title}
{caption ? (

{caption}

) : null} {delivery?.provenance_line ? (

{delivery.provenance_line}

) : null} {adoptLocked ? (

{RECTIFICATION_USER_COPY.rangeDeliveryAdoptLocked}

) : null} {delivery?.tie_break_note ? (

{delivery.tie_break_note}

) : null} {sharedTraits.length > 0 ? ( ) : null} {delivery?.more_label ? (

{delivery.more_label}

) : null}

{delivery?.boundary ?? REPRESENTATIVE_MINUTE_DISCLAIMER}

); }