diff --git a/packages/@sanity/vision/src/components/DownloadCsvButton.tsx b/packages/@sanity/vision/src/components/DownloadCsvButton.tsx new file mode 100644 index 00000000000..7ac98836972 --- /dev/null +++ b/packages/@sanity/vision/src/components/DownloadCsvButton.tsx @@ -0,0 +1,37 @@ +import {DocumentSheetIcon} from '@sanity/icons' +import {Button, Tooltip} from '@sanity/ui' +import {type MouseEvent} from 'react' +import {useTranslation} from 'sanity' + +import {visionLocaleNamespace} from '../i18n' + +function preventDownload(evt: MouseEvent) { + return evt.preventDefault() +} + +export function DownloadCsvButton({csvUrl}: {csvUrl: string | undefined}) { + const {t} = useTranslation(visionLocaleNamespace) + const isDisabled = !csvUrl + + const button = ( +