mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-18 08:17:18 +00:00
add drill down dimensions and metric period compare and modify layout (#22)
* [feature](webapp) add drill down dimensions and metric period compare and modify layout * [feature](webapp) add drill down dimensions and metric period compare and modify layout --------- Co-authored-by: williamhliu <williamhliu@tencent.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import classNames from 'classnames';
|
||||
import { PREFIX_CLS } from '../../../common/constants';
|
||||
import IconFont from '../../IconFont';
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
const PeriodCompareItem: React.FC<Props> = ({ title, value }) => {
|
||||
const prefixCls = `${PREFIX_CLS}-metric-card`;
|
||||
|
||||
const itemValueClass = classNames(`${prefixCls}-period-compare-item-value`, {
|
||||
[`${prefixCls}-period-compare-item-value-up`]: !value.includes('-'),
|
||||
[`${prefixCls}-period-compare-item-value-down`]: value.includes('-'),
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={`${prefixCls}-period-compare-item`}>
|
||||
<div className={`${prefixCls}-period-compare-item-title`}>{title}</div>
|
||||
<div className={itemValueClass}>
|
||||
<IconFont type={!value.includes('-') ? 'icon-shangsheng' : 'icon-xiajiang'} />
|
||||
<div>{value}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PeriodCompareItem;
|
||||
Reference in New Issue
Block a user