mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 20:51:48 +00:00
(feature)(chat-sdk) add time display above card (#1667)
This commit is contained in:
@@ -256,6 +256,7 @@ export type SimilarQuestionType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ParseTimeCostType = {
|
export type ParseTimeCostType = {
|
||||||
|
parseStartTime: number;
|
||||||
parseTime: number;
|
parseTime: number;
|
||||||
sqlTime: number;
|
sqlTime: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import Tools from '../Tools';
|
|||||||
import SqlItem from './SqlItem';
|
import SqlItem from './SqlItem';
|
||||||
import SimilarQuestionItem from './SimilarQuestionItem';
|
import SimilarQuestionItem from './SimilarQuestionItem';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
msg: string;
|
msg: string;
|
||||||
conversationId?: number;
|
conversationId?: number;
|
||||||
@@ -326,6 +327,11 @@ const ChatItem: React.FC<Props> = ({
|
|||||||
<div className={prefixCls}>
|
<div className={prefixCls}>
|
||||||
{!isMobile && <IconFont type="icon-zhinengsuanfa" className={`${prefixCls}-avatar`} />}
|
{!isMobile && <IconFont type="icon-zhinengsuanfa" className={`${prefixCls}-avatar`} />}
|
||||||
<div className={isMobile ? `${prefixCls}-mobile-msg-card` : ''}>
|
<div className={isMobile ? `${prefixCls}-mobile-msg-card` : ''}>
|
||||||
|
<div className={`${prefixCls}-time`}>
|
||||||
|
{parseTimeCost?.parseStartTime
|
||||||
|
? dayjs(parseTimeCost.parseStartTime).format('M月D日 HH:mm')
|
||||||
|
: ''}
|
||||||
|
</div>
|
||||||
<div className={contentClass}>
|
<div className={contentClass}>
|
||||||
<ParseTip
|
<ParseTip
|
||||||
isSimpleMode={isSimpleMode}
|
isSimpleMode={isSimpleMode}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
@similar-questions-prefix-cls: ~'@{supersonic-chat-prefix}-similar-questions';
|
@similar-questions-prefix-cls: ~'@{supersonic-chat-prefix}-similar-questions';
|
||||||
|
|
||||||
.@{chat-item-prefix-cls} {
|
.@{chat-item-prefix-cls} {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@@ -93,6 +94,12 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-time {
|
||||||
|
position: absolute;
|
||||||
|
top: -22px;
|
||||||
|
color: var(--text-color-fourth);
|
||||||
|
}
|
||||||
|
|
||||||
&-mobile-msg-card {
|
&-mobile-msg-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user