import React from 'react'; import ScrollCard from '@/components/scroll-card'; import { CardProps } from 'antd/es/card'; import { Statistic } from 'antd'; import { List } from '@sensoro/sensoro-design'; import styles from './index.less'; import { ListProps } from '@sensoro/sensoro-design/lib/list'; import useResponsive from '@/common/hooks/use-responsive'; export interface ListCardProps extends CardProps { total?: number; height?: string | number; onLoadMore?: () => Promise; minItemWidth?: number; listStyle?: React.CSSProperties; listProps?: ListProps; } const valueStyle = { color: '#2B6DE5', fontSize: 12, background: ' #F0F8FF', padding: '2px 8px', borderRadius: '2px', }; // 如果有必要可以把这个上啦加载更多的组件封装到组件库 const ListCard: React.FC = props => { const { children, title, total = 0, minItemWidth = 165, height, onLoadMore, listStyle, listProps, ...rest } = props; const { container, itemWidth } = useResponsive(minItemWidth); return ( // @ts-ignore {title && ( <> {title}{' '} )} ) } >
{React.Children.map(children, (child: any) => (
{React.cloneElement(child, { width: itemWidth })}
))}
); }; export default ListCard;