Skip to content

@pgege/kaboo-react


Function: useInterruptRenderer()

useInterruptRenderer(type): ComponentType\<InterruptRendererProps\<any>>

Defined in: src/context/InterruptRenderers.tsx:84

The renderer for a request kind: the app's override when one was provided, otherwise the built-in InterruptRenderer (approval and question cards, and a minimal card for any other kind).

Parameters

type

string

Returns

ComponentType\<InterruptRendererProps\<any>>

Example

import { useInterruptRenderer, type InterruptReason } from "@pgege/kaboo-react";

function Prompt({ reason }: { reason: InterruptReason }) {
  const Renderer = useInterruptRenderer(reason.type);
  return <Renderer reason={reason} onResolve={() => {}} onCancel={() => {}} />;
}