1 import { useActiveBreakpoint } from '@proton/components';
2 import clsx from '@proton/utils/clsx';
4 import type { useBookmarksPublicView } from '../../../store';
5 import { useDownload, useDownloadScanFlag } from '../../../store';
6 import { SaveToDriveButton } from '../Bookmarks/SaveToDriveButton';
7 import type { DownloadButtonProps } from './DownloadButton';
8 import { DownloadButton } from './DownloadButton';
9 import ReportAbuseButton from './ReportAbuseButton';
11 interface Props extends DownloadButtonProps {
12 bookmarksPublicView: ReturnType<typeof useBookmarksPublicView>;
13 partialView?: boolean;
14 hideSaveToDrive?: boolean;
16 const SharedPageFooter = ({ rootItem, items, bookmarksPublicView, hideSaveToDrive, partialView }: Props) => {
17 const { viewportWidth } = useActiveBreakpoint();
18 const { hasDownloads } = useDownload();
19 const isDownloadScanEnabled = useDownloadScanFlag();
20 const { isLoading, addBookmark, isAlreadyBookmarked, customPassword } = bookmarksPublicView;
22 if (viewportWidth['<=small']) {
28 'fixed bottom-0 p-4 flex flex-wrap justify-center bg-weak w-full gap-4'
31 {/* // Hide download button if transfer modal is present */}
32 {!!items.length && !hasDownloads && (
36 isScanAndDownload={isDownloadScanEnabled}
40 {!hideSaveToDrive && !partialView && (
44 alreadyBookmarked={isAlreadyBookmarked}
45 customPassword={customPassword}
51 return <ReportAbuseButton className="ml-1 mb-4 fixed left-0 bottom-0" linkInfo={rootItem} />;
54 export default SharedPageFooter;