diff --git a/apps/www/content/3.components/1.chatbot/confirmation.md b/apps/www/content/3.components/1.chatbot/confirmation.md index d72a050..1107c6d 100644 --- a/apps/www/content/3.components/1.chatbot/confirmation.md +++ b/apps/www/content/3.components/1.chatbot/confirmation.md @@ -194,21 +194,6 @@ export type ToolUIPartApproval approved: boolean reason?: string } - | { - id: string - approved: true - reason?: string - } - | { - id: string - approved: true - reason?: string - } - | { - id: string - approved: false - reason?: string - } | undefined export interface ConfirmationContextValue { @@ -220,7 +205,7 @@ export const ConfirmationKey: InjectionKey = Symbol('ConfirmationContext') export function useConfirmationContext() { - const context = inject(ConfirmationKey, null) + const context = inject(ConfirmationKey) if (!context) throw new Error('Confirmation components must be used within ') return context diff --git a/packages/elements/src/confirmation/context.ts b/packages/elements/src/confirmation/context.ts index 0bb55d5..5b5ebbe 100644 --- a/packages/elements/src/confirmation/context.ts +++ b/packages/elements/src/confirmation/context.ts @@ -13,21 +13,6 @@ export type ToolUIPartApproval approved: boolean reason?: string } - | { - id: string - approved: true - reason?: string - } - | { - id: string - approved: true - reason?: string - } - | { - id: string - approved: false - reason?: string - } | undefined export interface ConfirmationContextValue { @@ -39,7 +24,7 @@ export const ConfirmationKey: InjectionKey = Symbol('ConfirmationContext') export function useConfirmationContext() { - const context = inject(ConfirmationKey, null) + const context = inject(ConfirmationKey) if (!context) throw new Error('Confirmation components must be used within ') return context