1.0.2 • Published 5 months ago
@product-partner/pp-chatbot v1.0.2
Chat Component PP React
Development
comment out the App in App.tsx and import it as {App} in main.tsx and it would start working check your .env file for the VITE_SITE_URL the dev environment uses a proxy to go to stage.productpartner.ai
Usage
import { ChatBot } from "pp-chatbot";
const App = () => {
return <ChatBot />;
};📦 Props Table – ChatBot
| Prop | Type | Required | Description |
|---|---|---|---|
messages | { id: string; content: string; role?: string }[] | No | Array of message objects, each with an id, content, and optional role. |
suggestions | string[] | No | Optional array of suggestion strings. |
loading | boolean | Yes | Indicates if a loading state is active. |
onSubmit | (val: string) => void | Yes | Callback triggered when a message is submitted. |
onFileChange | (val: File[]) => void | Yes | Callback triggered when files are added. |
files | File[] | Yes | Array of currently selected files. |
removeFile | (val: File) => void | Yes | Callback to remove a selected file. |