| 1 | import { useT } from "../lib/i18n"; |
| 2 | import type { WireApproval } from "../lib/types"; |
| 3 | import { PromptShelf } from "./PromptShelf"; |
| 4 | |
| 5 | // Old Auto Guard approvals are historical facts. They remain readable without |
| 6 | // confirmation, retry, grant, or replay controls. |
| 7 | export function RetiredRecoveryApproval({ approval }: { approval: WireApproval }) { |
| 8 | const t = useT(); |
| 9 | const recovery = approval.recovery; |
| 10 | const action = recovery?.next_action || recovery?.next_tool || approval.subject; |
| 11 | const detail = recovery?.failed_summary || recovery?.diagnosis || recovery?.change_rationale || recovery?.review_rationale; |
| 12 | return ( |
| 13 | <PromptShelf |
| 14 | className="prompt-shelf--recovery-history" |
| 15 | titleId="recovery-history-title" |
| 16 | title={t("toolRecovery.historicalTitle")} |
| 17 | role="region" |
| 18 | > |
| 19 | <section className="recovery-summary" aria-label={t("approval.recoverySummaryLabel")}> |
| 20 | <p className="recovery-summary__reason">{t("toolRecovery.retired")}</p> |
| 21 | {action && ( |
| 22 | <p className="recovery-summary__action"> |
| 23 | <span>{t("approval.recoveryNextLabel")}</span> |
| 24 | <code>{action}</code> |
| 25 | </p> |
| 26 | )} |
| 27 | {detail && <p className="recovery-summary__reason">{detail}</p>} |
| 28 | </section> |
| 29 | </PromptShelf> |
| 30 | ); |
| 31 | } |
| 32 |