(improvement)(chat-sdk) optimize tip and card title (#1652)

This commit is contained in:
williamhliu
2024-09-11 19:17:27 +08:00
committed by GitHub
parent fb96ce5843
commit 91982a99eb
5 changed files with 12 additions and 8 deletions

View File

@@ -10,11 +10,12 @@ import { useState } from 'react';
type Props = {
data: MsgDataType;
question: string;
loading: boolean;
onApplyAuth?: (model: string) => void;
};
const MetricCard: React.FC<Props> = ({ data, loading, onApplyAuth }) => {
const MetricCard: React.FC<Props> = ({ data, question, loading, onApplyAuth }) => {
const { queryMode, queryColumns, queryResults, entityInfo, aggregateInfo } = data;
const { metricInfos } = aggregateInfo || {};
@@ -39,11 +40,7 @@ const MetricCard: React.FC<Props> = ({ data, loading, onApplyAuth }) => {
return (
<div className={matricCardClass}>
<div className={`${prefixCls}-top-bar`}>
{indicatorColumn?.name ? (
<div className={`${prefixCls}-indicator-name`}>{indicatorColumn?.name}</div>
) : (
<div style={{ height: 10 }} />
)}
<div className={`${prefixCls}-indicator-name`}>{question}</div>
</div>
<Spin spinning={loading}>
<div className={`${prefixCls}-indicator`}>