import React, { FC } from 'react'; import classNames from '@pansy/classnames'; import { Button, Typography } from 'antd'; import { Empty } from '@sensoro/sensoro-design'; import { CloseCircleFilled } from '@ant-design/icons'; import Icon from '@sensoro/library/lib/components/icon-font'; import { DeviceInfo } from '../interface'; import styles from './card.less'; import { iconMap } from '../config'; interface CardProps { className?: string; devices?: DeviceInfo[]; deviceKey: string; onReset?: () => void; onRemove?: (id: string) => void; } const { Paragraph } = Typography; const Card: FC = props => { const { className, devices = [], onRemove, onReset, deviceKey } = props; const handleReset = () => { onReset?.(); }; const handleRemove = (id: string) => { onRemove?.(id); }; return (
{devices.length} 台
已选择设备
{devices.map((item, index) => { return (
{item.name}
{ handleRemove(item[deviceKey]); }} >
); })} {devices.length === 0 && ( )}
); }; export default Card;