1 import { FileIcon } from '@proton/components';
2 import { isCompatibleCBZ } from '@proton/shared/lib/helpers/mimetype';
3 import clsx from '@proton/utils/clsx';
5 import SignatureIcon from '../../SignatureIcon';
6 import type { DriveItem } from '../Drive/Drive';
7 import type { SharedLinkItem } from '../SharedLinks/SharedLinks';
8 import type { SharedWithMeItem } from '../SharedWithMe/SharedWithMe';
9 import type { TrashItem } from '../Trash/Trash';
10 import GridViewItemBase from './GridViewItem';
11 import { getLinkIconText } from './utils';
13 export function GridViewItem({ item }: { item: DriveItem | TrashItem | SharedLinkItem | SharedWithMeItem }) {
14 const iconText = getLinkIconText({
16 mimeType: item.mimeType,
20 const IconComponent = (
22 {item.cachedThumbnailUrl ? (
24 src={item.cachedThumbnailUrl}
26 'file-browser-grid-item--thumbnail',
28 // In the future: Music Cover, M4B Audiobook Cover, and other types that are not images that also have covers in their metadata
29 isCompatibleCBZ(item.mimeType, item.name) ? 'object-contain' : 'object-cover'
35 className="file-browser-grid-item--icon"
37 mimeType={item.isFile ? item.mimeType : 'Folder'}
46 IconComponent={IconComponent}
47 SignatureIconComponent={
50 signatureIssues={item.signatureIssues}
51 isAnonymous={!item.activeRevision?.signatureAddress && !item.signatureAddress}
52 className="file-browser-grid-view--signature-icon"