Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / applications / drive / src / app / components / sections / Trash / TrashView.tsx
blobd1085ba71fdd941daebbec772cd7254d735b13af
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();
22     return (
23         <FileBrowserStateProvider itemIds={trashView.items.map(({ linkId }) => linkId)}>
24             <ToolbarRow
25                 titleArea={<span className="text-strong pl-1">{c('Info').t`Trash`}</span>}
26                 toolbar={<TrashToolbar items={trashView.items} />}
27             />
28             <EmptyTrashNotification className="border-bottom border-weak" disabled={trashView.items.length === 0} />
29             <Trash shareId={activeShareId} trashView={trashView} />
30         </FileBrowserStateProvider>
31     );
33 export default TrashView;