|
|
|
@@ -14,6 +14,10 @@ type ResourceItemProps = { |
|
|
|
}; |
|
|
|
|
|
|
|
function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) { |
|
|
|
const timeAgo = |
|
|
|
'最近更新: ' + |
|
|
|
(item.update_time ? formatDate(item.update_time, 'YYYY-MM-DD') : item.time_ago ?? ''); |
|
|
|
const create_by = item.create_by ?? ''; |
|
|
|
return ( |
|
|
|
<div className={styles['resource-item']} onClick={() => onClick(item)}> |
|
|
|
<Flex justify="space-between" align="center" style={{ marginBottom: '20px', height: '32px' }}> |
|
|
|
@@ -37,7 +41,7 @@ function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) |
|
|
|
)} |
|
|
|
</Flex> |
|
|
|
<div className={styles['resource-item__description']}>{item.description}</div> |
|
|
|
<Flex justify="space-between"> |
|
|
|
<Flex justify="space-between" gap={'0 8px'}> |
|
|
|
<div className={styles['resource-item__time']}> |
|
|
|
<img |
|
|
|
style={{ width: '17px', marginRight: '6px' }} |
|
|
|
@@ -45,14 +49,11 @@ function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) |
|
|
|
draggable={false} |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
<span>{item.create_by ?? ''}</span> |
|
|
|
<Typography.Text ellipsis={{ tooltip: create_by }}>{create_by}</Typography.Text> |
|
|
|
</div> |
|
|
|
<div className={styles['resource-item__time']}> |
|
|
|
<img style={{ width: '12px', marginRight: '5px' }} src={clock} draggable={false} alt="" /> |
|
|
|
<span> |
|
|
|
{'最近更新: '} |
|
|
|
{item.update_time ? formatDate(item.update_time, 'YYYY-MM-DD') : item.time_ago ?? ''} |
|
|
|
</span> |
|
|
|
<Typography.Text ellipsis={{ tooltip: timeAgo }}>{timeAgo}</Typography.Text> |
|
|
|
</div> |
|
|
|
</Flex> |
|
|
|
</div> |
|
|
|
|