-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chat: create storybook case for customized message #28662
base: 25_1
Are you sure you want to change the base?
Conversation
e60a28a
to
2fb624e
Compare
2fb624e
to
5314705
Compare
height={height} | ||
width={width} | ||
items={items} | ||
reloadOnChange={false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use DataSource object. I assume that this property doesn't matter for this sample.
@@ -13,7 +13,8 @@ | |||
"dependencies": { | |||
"devextreme": "workspace:~", | |||
"devextreme-react": "workspace:~", | |||
"inferno": "^7.4.9" | |||
"inferno": "^7.4.9", | |||
"html-react-parser": "5.2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"html-react-parser": "5.2.2" | |
"html-react-parser": "^5.2.2" |
|
||
export const AIBotIntegration: Story = { | ||
args: { | ||
width: 500, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's omit dimensions options for this sample and pass them directly in Chat
width, | ||
height, | ||
alerts, | ||
}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure the formatting here is correct? Please kindly check it
}) => { | ||
const [isProcessing, setIsProcessing] = useState(false); | ||
const [assistantReplyIndex, setAssistantReplyIndex] = useState<number>(0); | ||
const [copyBtnIcon, setCopyBtnIcon] = useState('copy'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [copyBtnIcon, setCopyBtnIcon] = useState('copy'); | |
const [copyButtonIcon, setCopyButtonIcon] = useState('copy'); |
const repliesCount = assistantReplies.length; | ||
const assistantReply = isProcessing ? regenerationMessage : assistantReplies[assistantReplyIndex % repliesCount]; | ||
|
||
return [ userRequest, assistantReply ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return [ userRequest, assistantReply ]; | |
return [userRequest, assistantReply]; |
</li> | ||
</ul> | ||
<p>AI continues to evolve, impacting nearly every aspect of modern life while raising | ||
ethical, societal, and technological challenges.</p>`.replace(/\s{2,}/gm, ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's better to move this operation to the code so it applies to all input values and avoid duplication.
{HTMLReactParser(text.replace(/\s{2,}/gm, ''))}
What do you think?
reloadOnChange={false} | ||
showAvatar | ||
showDayHeaders={false} | ||
showMessageTimestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing showAvatar, showMessageTimestamp, and showUserName since their default value is already true, and we don't override them
No description provided.