1 import { useRef } from 'react';
3 import { c } from 'ttag';
5 import { Button } from '@proton/atoms';
6 import { Icon, TimeIntl } from '@proton/components';
8 import type { DriveFileRevision } from '../../store';
9 import { useContextMenuControls } from '../FileBrowser';
10 import { RevisionsItemContextMenu } from './RevisionsItemContextMenu';
12 import './RevisionListItem.scss';
14 const RevisionListItem = ({
19 revision: DriveFileRevision;
20 formatType?: 'date' | 'time';
23 const contextMenuControls = useContextMenuControls();
24 const ref = useRef<HTMLButtonElement>(null);
25 const options: Intl.DateTimeFormatOptions =
37 <RevisionsItemContextMenu
39 isOpen={contextMenuControls.isOpen}
40 position={contextMenuControls.position}
41 open={contextMenuControls.open}
42 close={contextMenuControls.close}
46 <li className="revision-list-item mb-4">
47 <TimeIntl className="flex-1" options={options}>
50 <p className="text-ellipsis text-center m-0">{revision.signatureEmail}</p>
58 contextMenuControls.handleContextMenu(e);
61 contextMenuControls.handleContextMenuTouch(e);
64 <Icon name="three-dots-vertical" alt={c('Action').t`More options`} />
71 export default RevisionListItem;