Render certain AI responses in unique ways
WidgetComponentProps
type makes it easy to type your component. It accepts a generic type that describes the shape of the data that will be passed to the component.
The shape of the data is the response of the called action. For example, if you have a getAccountBalance
action which calls your backend, you would know that your backend responds with this shape: { balance: number, currency: string }
, so you can inject this shape into the WidgetComponentProps
generic type, giving you type safety.