overleaf/services/web/frontend/js/features/editor-left-menu/components/download-source.tsx
Jimmy Domagala-Tang b2e74464a2 Merge pull request #14207 from overleaf/jdt-editor-events
editor events

GitOrigin-RevId: 8d74576d4f8117ecca47402afcc9cee229dd0dca
2023-08-23 08:05:23 +00:00

29 lines
772 B
TypeScript

import { useTranslation } from 'react-i18next'
import { useProjectContext } from '../../../shared/context/project-context'
import Icon from '../../../shared/components/icon'
import * as eventTracking from '../../../infrastructure/event-tracking'
export default function DownloadSource() {
const { t } = useTranslation()
const { _id: projectId } = useProjectContext()
function sendDownloadEvent() {
eventTracking.sendMB('download-zip-button-click', {
projectId,
location: 'left-menu',
})
}
return (
<a
href={`/project/${projectId}/download/zip`}
target="_blank"
rel="noreferrer"
onClick={sendDownloadEvent}
>
<Icon type="file-archive-o" modifier="2x" />
<br />
{t('source')}
</a>
)
}