2024-08-05 08:08:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2024-08-06 04:02:47 +00:00
|
|
|
const RecentlyUsedListItem = ({ item, isSelected, onItemClick }) => {
|
2024-09-23 01:48:43 +00:00
|
|
|
const title = item.path === '/' ? item.path : item.path.split('/').pop();
|
2024-08-05 08:08:05 +00:00
|
|
|
|
|
|
|
const handleItemClick = () => {
|
2024-08-06 04:02:47 +00:00
|
|
|
onItemClick(item.repo, item.path);
|
2024-08-05 08:08:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<li>
|
|
|
|
<div className={`${isSelected ? 'item-active' : ''} item-info recently-used`} onClick={handleItemClick}>
|
|
|
|
<div className="item-left-icon">
|
|
|
|
<i className="tree-node-icon">
|
|
|
|
<span className="icon sf3-font sf3-font-folder tree-node-icon"></span>
|
|
|
|
</i>
|
|
|
|
</div>
|
|
|
|
<div className="item-text">
|
|
|
|
<span className="name user-select-none ellipsis" title={title}>{title}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RecentlyUsedListItem;
|