|
1 | 1 | import React, { useMemo } from "react"; |
2 | 2 | import * as DefaultIcons from "./Icons"; |
3 | 3 |
|
| 4 | +/** |
| 5 | + * Icons for CopilotKitChat component. |
| 6 | + */ |
4 | 7 | export interface CopilotKitChatIcons { |
| 8 | + /** |
| 9 | + * The icon to use for the open chat button. |
| 10 | + * @default <OpenIcon /> |
| 11 | + */ |
5 | 12 | openIcon?: React.ReactNode; |
| 13 | + |
| 14 | + /** |
| 15 | + * The icon to use for the close chat button. |
| 16 | + * @default <CloseIcon /> |
| 17 | + */ |
6 | 18 | closeIcon?: React.ReactNode; |
| 19 | + |
| 20 | + /** |
| 21 | + * The icon to use for the close chat button in the header. |
| 22 | + * @default <HeaderCloseIcon /> |
| 23 | + */ |
7 | 24 | headerCloseIcon?: React.ReactNode; |
| 25 | + |
| 26 | + /** |
| 27 | + * The icon to use for the send button. |
| 28 | + * @default <SendIcon /> |
| 29 | + */ |
8 | 30 | sendIcon?: React.ReactNode; |
| 31 | + |
| 32 | + /** |
| 33 | + * The icon to use for the activity indicator. |
| 34 | + * @default <ActivityIcon /> |
| 35 | + */ |
9 | 36 | activityIcon?: React.ReactNode; |
| 37 | + |
| 38 | + /** |
| 39 | + * The icon to use for the spinner. |
| 40 | + * @default <SpinnerIcon /> |
| 41 | + */ |
10 | 42 | spinnerIcon?: React.ReactNode; |
| 43 | + |
| 44 | + /** |
| 45 | + * The icon to use for the stop button. |
| 46 | + * @default <StopIcon /> |
| 47 | + */ |
11 | 48 | stopIcon?: React.ReactNode; |
| 49 | + |
| 50 | + /** |
| 51 | + * The icon to use for the regenerate button. |
| 52 | + * @default <RegenerateIcon /> |
| 53 | + */ |
12 | 54 | regenerateIcon?: React.ReactNode; |
13 | 55 | } |
14 | 56 |
|
| 57 | +/** |
| 58 | + * Labels for CopilotKitChat component. |
| 59 | + */ |
15 | 60 | export interface CopilotKitChatLabels { |
| 61 | + /** |
| 62 | + * The initial message(s) to display in the chat window. |
| 63 | + */ |
16 | 64 | initial?: string | string[]; |
| 65 | + |
| 66 | + /** |
| 67 | + * The title to display in the header. |
| 68 | + * @default "CopilotKit" |
| 69 | + */ |
17 | 70 | title?: string; |
| 71 | + |
| 72 | + /** |
| 73 | + * The placeholder to display in the input. |
| 74 | + * @default "Type a message..." |
| 75 | + */ |
18 | 76 | placeholder?: string; |
| 77 | + |
| 78 | + /** |
| 79 | + * The message to display while the chat is thinking. |
| 80 | + * @default "Thinking..." |
| 81 | + */ |
19 | 82 | thinking?: string; |
| 83 | + |
| 84 | + /** |
| 85 | + * The message to display when the chat is done thinking. |
| 86 | + * @default "✅ Done" |
| 87 | + */ |
20 | 88 | done?: string; |
| 89 | + |
| 90 | + /** |
| 91 | + * The message to display when an error occurs. |
| 92 | + * @default "❌ An error occurred. Please try again." |
| 93 | + */ |
21 | 94 | error?: string; |
| 95 | + |
| 96 | + /** |
| 97 | + * The message to display when the user clicks the stop button. |
| 98 | + * @default "Stop generating" |
| 99 | + */ |
22 | 100 | stopGenerating?: string; |
| 101 | + |
| 102 | + /** |
| 103 | + * The message to display when the user clicks the regenerate button. |
| 104 | + * @default "Regenerate response" |
| 105 | + */ |
23 | 106 | regenerateResponse?: string; |
24 | 107 | } |
25 | 108 |
|
@@ -62,7 +145,7 @@ export const ChatContextProvider: React.FC<ChatContextProps> = ({ |
62 | 145 | labels: { |
63 | 146 | ...{ |
64 | 147 | initial: "", |
65 | | - title: "Assistant", |
| 148 | + title: "CopilotKit", |
66 | 149 | placeholder: "Type a message...", |
67 | 150 | thinking: "Thinking...", |
68 | 151 | done: "✅ Done", |
|
0 commit comments