baseCard.tsx 673 B

1234567891011121314151617181920212223242526
  1. import Header from './header';
  2. import type { HeaderProps } from './header';
  3. import Echarts from './echarts';
  4. import type { EchartsProps } from './echarts';
  5. import Style from './index.less';
  6. import classNames from 'classnames';
  7. interface BaseCardProps extends HeaderProps, EchartsProps {
  8. height: number;
  9. className?: string;
  10. }
  11. export default (props: BaseCardProps) => {
  12. const { height, className, options, ...formProps } = props;
  13. return (
  14. <div
  15. className={classNames(Style['dash-board-echarts'], className)}
  16. style={{
  17. height: height || 200,
  18. }}
  19. >
  20. <Header {...formProps} />
  21. <Echarts options={options} />
  22. </div>
  23. );
  24. };