import React, { useMemo, useRef } from 'react'; import classNames from '@pansy/classnames'; import { PictureOutlined } from '@ant-design/icons'; import styles from './index.less'; import { Empty } from '@sensoro/sensoro-design'; interface PictureCardProps { className?: string; style?: React.CSSProperties; data?: string[]; iconShow?: boolean; } const PictureCard: React.FC = props => { const { className, data = [], style = {}, iconShow } = props; let imgLength = Number(data?.length); let lastImg = imgLength > 0 && data[0]['url']; /* eslint-disable */ const newStyle = { ...style, backgroundImage: `url(${lastImg})`, } as React.CSSProperties; return (
{imgLength > 0 && iconShow && (
{imgLength}
)} {imgLength === 0 && }
); }; PictureCard.defaultProps = { data: [], iconShow: true, }; export default PictureCard;