import { useChatContext } from './chat'
import type { JSX } from 'solid-js'
/** @deprecated Use `createChatUI()` interrupt components with `chat.interrupts`. Deprecated in 0.8.0. Removed in 1.0.0. */
export interface ToolApprovalProps {
/** Tool call ID */
toolCallId: string
/** Tool name */
toolName: string
/** Parsed tool arguments/input */
input: any
/** Approval metadata */
approval: {
id: string
needsApproval: boolean
approved?: boolean
}
/** CSS class name */
class?: string
/** Custom render prop */
children?: (props: ToolApprovalRenderProps) => JSX.Element
}
export interface ToolApprovalRenderProps {
/** Tool name */
toolName: string
/** Parsed input */
input: any
/** Approve the tool call */
onApprove: () => void
/** Deny the tool call */
onDeny: () => void
/** Whether user has responded */
hasResponded: boolean
/** User's decision (if responded) */
approved?: boolean
}
/**
* @deprecated Use `createChatUI()` interrupt components with `chat.interrupts`. Deprecated in 0.8.0. Removed in 1.0.0.
*
* Tool approval component - renders approve/deny buttons for tools that need approval
*
* @example
* ```tsx
* {part.approval && (
*
{JSON.stringify(props.input, null, 2)}