Skip to content
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

Open
wants to merge 2 commits into
base: 25_1
Choose a base branch
from

Conversation

anna-shakhova
Copy link
Contributor

No description provided.

@anna-shakhova anna-shakhova requested a review from a team January 3, 2025 12:29
@anna-shakhova anna-shakhova self-assigned this Jan 3, 2025
@anna-shakhova anna-shakhova force-pushed the custom-chat-story branch 2 times, most recently from e60a28a to 2fb624e Compare January 3, 2025 15:07
height={height}
width={width}
items={items}
reloadOnChange={false}
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"html-react-parser": "5.2.2"
"html-react-parser": "^5.2.2"


export const AIBotIntegration: Story = {
args: {
width: 500,
Copy link
Contributor

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,
}) => {
Copy link
Contributor

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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [copyBtnIcon, setCopyBtnIcon] = useState('copy');
const [copyButtonIcon, setCopyButtonIcon] = useState('copy');

const repliesCount = assistantReplies.length;
const assistantReply = isProcessing ? regenerationMessage : assistantReplies[assistantReplyIndex % repliesCount];

return [ userRequest, assistantReply ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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, ''),
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants