-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custom message component as prop
- Loading branch information
Showing
9 changed files
with
8,395 additions
and
8,081 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { BaseMessage } from './ChatScreenPA'; | ||
|
||
export declare function AIMessageTrendsFunnels<T extends BaseMessage>({ index, messages, handleRegenerateResponse, }: { | ||
export declare function AIMessageTrendsFunnels<T extends BaseMessage>({ index, messages, showMessageActionCard, handleRegenerateResponse, }: { | ||
index: number; | ||
messages: T[]; | ||
showMessageActionCard?: boolean; | ||
handleRegenerateResponse: (userQuery: string, regenerateResponse?: boolean) => void; | ||
}): import("react/jsx-runtime").JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
export interface BaseMessage { | ||
content: any; | ||
type: string; | ||
type: 'ai' | 'human'; | ||
} | ||
export interface CustomMessageComponentProp<T> { | ||
type: 'ai' | 'human'; | ||
component: ({ index, message, handleSendFollowupMessage, }: { | ||
message: T; | ||
index?: number; | ||
handleSendFollowupMessage?: (userQuery: string, regenerateResponse?: boolean) => void; | ||
}) => ReactNode; | ||
} | ||
export interface ChatScreenPAProps<T> { | ||
messages: T[]; | ||
handleSendFollowupMessage: (userQuery: string, regenerateResponse?: boolean) => void; | ||
isMessageLoading: boolean; | ||
setMessages: React.Dispatch<React.SetStateAction<T[]>>; | ||
showMessageActionCard?: boolean; | ||
hideActionCardItems?: ('copy' | 'regenerate')[]; | ||
customMessageComponent?: CustomMessageComponentProp<T>; | ||
customMessageActionCardItem?: ReactNode[]; | ||
} | ||
export declare function ChatScreenPA<T extends BaseMessage>({ messages, handleSendFollowupMessage, isMessageLoading, setMessages, }: ChatScreenPAProps<T>): import("react/jsx-runtime").JSX.Element; | ||
export declare function ChatScreenPA<T extends BaseMessage>({ messages, handleSendFollowupMessage, isMessageLoading, setMessages, showMessageActionCard, hideActionCardItems, customMessageComponent, customMessageActionCardItem, }: ChatScreenPAProps<T>): import("react/jsx-runtime").JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ReactNode } from 'react'; | ||
import { BaseMessage } from './ChatScreenPA'; | ||
|
||
export default function MessageActionCard<T extends BaseMessage>({ index, messages, handleRegenerateResponse, hideActionCardItems, customMessageActionCardItem, }: { | ||
index: number; | ||
messages: T[]; | ||
handleRegenerateResponse: (userQuery: string, regenerateResponse?: boolean) => void; | ||
hideActionCardItems?: ('copy' | 'regenerate')[]; | ||
customMessageActionCardItem?: ReactNode[]; | ||
}): import("react/jsx-runtime").JSX.Element; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ui-gallery", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"type": "module", | ||
"files": [ | ||
"package-dist" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.