| | |
| | | import ItemTypes from './itemtypes' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, icon, text, menutype, moveCard, findCard, editCard, closeCard }) => { |
| | | const Card = ({ id, card, moveCard, findCard, editCard, closeCard }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: ItemTypes.CARD, id, originalIndex }, |
| | |
| | | return ( |
| | | <div className="side-card" style={{ opacity }}> |
| | | <div ref={node => drag(drop(node))}> |
| | | {icon && <Icon type={icon} />} |
| | | {text} |
| | | {card.PageParam && card.PageParam.Icon && <Icon type={card.PageParam.Icon} />} |
| | | {card.text} |
| | | </div> |
| | | {menutype === 'CommonTable' ? <Icon className="edit" type="edit" onClick={edit} /> : null} |
| | | {!card.forbidden ? <Icon className="edit" type="edit" onClick={edit} /> : null} |
| | | <Icon className="close" type="close" onClick={close} /> |
| | | </div> |
| | | ) |