Commit 705ee3a0 by 李伟康

fix(chat): 修复建议问题点击发送的内容显示问题

- 修复InitSuggest组件中点击建议问题时发送的内容,统一使用question.text字段
- 移除toast组件中的minWidth样式属性,优化弹窗宽度自适应效果
1 parent 8ca13ec3
......@@ -51,7 +51,7 @@ const InitSuggest: FC<InitSuggestProps> = ({ suggestedQuestions = [] }) => {
<div
className={cn(s['suggested-questions-item'], 'flex')}
key={index}
onClick={() => onSend?.(question.fullText || question.text, InputMessageType.QUESTION_IN_WELCOME)}>
onClick={() => onSend?.(question.text, InputMessageType.QUESTION_IN_WELCOME)}>
{question.group && question.group !== '默认' && (
<span className={cn(s['suggested-questions-item-group'])}>{question.group}</span>
)}
......
......@@ -31,7 +31,7 @@ const Toast = ({ type = 'info', size = 'md', message, children, className, custo
if (typeof message !== 'string') return null
return (
<div style={{ left: '50%', transform: 'translateX(-50%)', minWidth: '242px', maxWidth: 'min(343px, 91vw)', borderRadius: '54px' }} className={classNames(className, 'fixed my-4 flex-grow z-[9999] overflow-hidden', size === 'md' ? 'p-3' : 'p-2', 'top-0', 'right-0')}>
<div style={{ left: '50%', transform: 'translateX(-50%)', maxWidth: 'min(343px, 91vw)', borderRadius: '54px' }} className={classNames(className, 'fixed my-4 flex-grow z-[9999] overflow-hidden', size === 'md' ? 'p-3' : 'p-2', 'top-0', 'right-0')}>
<div className="absolute inset-0 -z-10" style={{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }} />
<div className={`flex ${size === 'md' ? 'gap-1' : 'gap-0.5'}`}>
<div className={`flex items-center justify-center ${size === 'md' ? 'p-0.5' : 'p-1'}`}>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!