"use client"; import { ArrowRight, Check, Loader2, X } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { PartnerInvocation } from "@/lib/partner-groups-api"; /** * A partner's proposal to ask one peer a follow-up question. * * Nothing has happened yet when this appears: the proposal is inert until the * user approves it, so the card leads with the question itself and keeps the * two actions plain. It stays visible after the decision as the audit trail * for why a follow-up round exists. */ export default function InvocationCard({ invocation, busy, showQuestion, onApprove, onReject, }: { invocation: PartnerInvocation; busy: boolean; /** False once the question is published as its own bubble downstream. */ showQuestion: boolean; onApprove: () => void; onReject: () => void; }) { const { t } = useTranslation(); const { status } = invocation; return (
{invocation.requester_partner_name} {invocation.target_partner_name}
{showQuestion ? (

{invocation.question}

) : null} {status === "pending" ? (
) : (
{status === "approved" ? ( <> {t("Waiting for {{name}}", { name: invocation.target_partner_name, })} ) : status === "completed" ? ( <> {t("Discussed")} ) : status === "failed" ? ( {invocation.error || t("Follow-up failed")} ) : ( <> {t("Declined")} )}
)}
); }