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 { useSharedLinksView } from '../../../store';
9 import { FileBrowserStateProvider } from '../../FileBrowser';
10 import ToolbarRow from '../ToolbarRow/ToolbarRow';
11 import SharedLinks from './SharedLinks';
12 import SharedLinksToolbar from './SharedLinksToolbar';
14 const SharedLinksView = () => {
15 useAppTitle(c('Title').t`Shared`);
16 const { activeShareId, setDefaultRoot } = useActiveShare();
17 useEffect(setDefaultRoot, []);
19 const sharedLinksView = useSharedLinksView(activeShareId);
22 <FileBrowserStateProvider itemIds={sharedLinksView.items.map(({ linkId }) => linkId)}>
24 titleArea={<span className="text-strong pl-1">{c('Info').t`My Links`}</span>}
25 toolbar={<SharedLinksToolbar shareId={activeShareId} items={sharedLinksView.items} />}
27 <SharedLinks shareId={activeShareId} sharedLinksView={sharedLinksView} />
28 </FileBrowserStateProvider>
32 export default SharedLinksView;