| | |
| | | import { Icon, Button, Popover } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, cardIds, type, card, moveCard, findCard, editCard, delCard, copyCard, profileCard, doubleClickCard }) => { |
| | | const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard, copyCard, profileCard, doubleClickCard }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'action', id, originalIndex }, |
| | |
| | | } |
| | | |
| | | let btnElement = null |
| | | if (type === 'chart') { |
| | | btnElement = (<Icon type={card.icon} className={'mk-icon mk-' + card.class} onClick={() => editCard(id)} />) |
| | | if (card.show === 'icon') { |
| | | btnElement = (<Icon type={card.icon} className={'mk-icon mk-' + card.class}/>) |
| | | } else if (card.show === 'link') { |
| | | btnElement = (<span className={'mk-link mk-' + card.class}>{card.label}{card.icon ? <Icon type={card.icon}/> : null}</span>) |
| | | } else { |
| | | btnElement = ( |
| | | <Button |