import type { ApprovalRequestId, ProviderApprovalDecision } from "@t3tools/contracts"; import { Pressable, View } from "react-native"; import { AppText as Text } from "../../components/AppText"; import type { PendingApproval } from "../../lib/threadActivity"; export interface PendingApprovalCardProps { readonly approval: PendingApproval; readonly respondingApprovalId: ApprovalRequestId | null; readonly onRespond: ( requestId: ApprovalRequestId, decision: ProviderApprovalDecision, ) => Promise; } export function PendingApprovalCard(props: PendingApprovalCardProps) { // Opaque for the same reason as PendingUserInputCard: nothing blurs the feed // behind this card, so a translucent surface bleeds messages through it. return ( Approval needed {props.approval.requestKind} {props.approval.detail ? ( {props.approval.detail} ) : null} void props.onRespond(props.approval.requestId, "accept")} > Allow once void props.onRespond(props.approval.requestId, "acceptForSession")} > Allow session void props.onRespond(props.approval.requestId, "decline")} > Decline ); }