RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/components/message/content/attachments/structure/AttachmentEncryptedDownload.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import type { ComponentProps } from 'react';
import React from 'react';

import { useDownloadFromServiceWorker } from '../../../../../hooks/useDownloadFromServiceWorker';
import AttachmentDownloadBase from './AttachmentDownloadBase';

type AttachmentDownloadProps = ComponentProps<typeof AttachmentDownloadBase>;

const AttachmentEncryptedDownload = ({ title, href, ...props }: AttachmentDownloadProps) => {
    const encryptedAnchorProps = useDownloadFromServiceWorker(href, title);

    return <AttachmentDownloadBase {...props} {...encryptedAnchorProps} title={title} href={href} />;
};

export default AttachmentEncryptedDownload;