2020-04-13 12:59:58 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2020-06-10 15:10:00 +02:00
|
|
|
import { useDrag } from 'react-dnd';
|
2020-04-13 12:59:58 +02:00
|
|
|
|
|
|
|
|
import { Icon } from '@ohif/ui';
|
|
|
|
|
|
2020-06-10 15:10:00 +02:00
|
|
|
const ThumbnailNoImage = ({
|
|
|
|
|
description,
|
|
|
|
|
seriesDate,
|
|
|
|
|
modality,
|
|
|
|
|
onClick,
|
|
|
|
|
dragData,
|
|
|
|
|
}) => {
|
|
|
|
|
const [collectedProps, drag, dragPreview] = useDrag({
|
|
|
|
|
item: { ...dragData },
|
|
|
|
|
canDrag: function(monitor) {
|
|
|
|
|
return Object.keys(dragData).length !== 0;
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-04-13 12:59:58 +02:00
|
|
|
return (
|
2020-04-14 00:35:32 +02:00
|
|
|
<div
|
2020-06-10 15:10:00 +02:00
|
|
|
ref={drag}
|
2020-04-14 00:35:32 +02:00
|
|
|
className="flex flex-row flex-1 px-4 py-3 cursor-pointer"
|
|
|
|
|
onClick={onClick}
|
2020-05-15 14:29:27 +02:00
|
|
|
onKeyDown={onClick}
|
|
|
|
|
role="button"
|
|
|
|
|
tabIndex="0"
|
2020-04-14 00:35:32 +02:00
|
|
|
>
|
2020-04-13 12:59:58 +02:00
|
|
|
<div className="flex flex-col flex-1">
|
|
|
|
|
<div className="flex flex-row flex-1 items-center mb-2">
|
2020-05-15 14:29:27 +02:00
|
|
|
<Icon name="list-bullets" className="text-secondary-light w-12" />
|
|
|
|
|
<div className="px-3 bg-primary-main rounded-sm mr-4 text-lg text-white">
|
2020-04-21 20:12:34 +02:00
|
|
|
{modality}
|
2020-04-13 12:59:58 +02:00
|
|
|
</div>
|
|
|
|
|
<span className="text-blue-300 text-base">{seriesDate}</span>
|
|
|
|
|
</div>
|
2020-05-15 14:29:27 +02:00
|
|
|
<div className="text-white text-base ml-12">{description}</div>
|
2020-04-13 12:59:58 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-21 20:12:34 +02:00
|
|
|
ThumbnailNoImage.propTypes = {
|
|
|
|
|
description: PropTypes.string.isRequired,
|
|
|
|
|
modality: PropTypes.string.isRequired,
|
|
|
|
|
seriesDate: PropTypes.string.isRequired,
|
2020-04-14 00:35:32 +02:00
|
|
|
onClick: PropTypes.func.isRequired,
|
2020-04-13 12:59:58 +02:00
|
|
|
};
|
|
|
|
|
|
2020-04-21 20:12:34 +02:00
|
|
|
export default ThumbnailNoImage;
|