1 import { useEffect } from 'react';
3 import { c } from 'ttag';
5 import { useAppTitle } from '@proton/components';
7 import { useActiveShare } from '../../../hooks/drive/useActiveShare';
8 import { useTrashView } from '../../../store';
9 import { FileBrowserStateProvider } from '../../FileBrowser';
10 import ToolbarRow from '../ToolbarRow/ToolbarRow';
11 import EmptyTrashNotification from './EmptyTrashNotification';
12 import Trash from './Trash';
13 import TrashToolbar from './TrashToolbar';
15 const TrashView = () => {
16 useAppTitle(c('Title').t`Trash`);
17 const { activeShareId, setDefaultRoot } = useActiveShare();
18 useEffect(setDefaultRoot, []);
20 const trashView = useTrashView();
23 <FileBrowserStateProvider itemIds={trashView.items.map(({ linkId }) => linkId)}>
25 titleArea={<span className="text-strong pl-1">{c('Info').t`Trash`}</span>}
26 toolbar={<TrashToolbar items={trashView.items} />}
28 <EmptyTrashNotification className="border-bottom border-weak" disabled={trashView.items.length === 0} />
29 <Trash shareId={activeShareId} trashView={trashView} />
30 </FileBrowserStateProvider>
33 export default TrashView;