1+ import { useState } from 'react' ;
2+
13import { Button } from '@sentry/scraps/button' ;
24
5+ import { ExportQueryType , useDataExport } from 'sentry/components/dataExport' ;
36import { DropdownMenu } from 'sentry/components/dropdownMenu' ;
4- import { ExportQueryType , useDataExport } from 'sentry/components/useDataExport' ;
57import { IconDownload } from 'sentry/icons' ;
68import { t } from 'sentry/locale' ;
79import type { Group } from 'sentry/types/group' ;
@@ -16,8 +18,9 @@ interface Props {
1618}
1719
1820export function TagExportDropdown ( { tagKey, group, organization, project} : Props ) {
21+ const [ isExportDisabled , setIsExportDisabled ] = useState ( false ) ;
1922 const hasDiscoverQuery = organization . features . includes ( 'discover-query' ) ;
20- const { isExportWorking , runExport } = useDataExport ( {
23+ const handleDataExport = useDataExport ( {
2124 payload : {
2225 queryType : ExportQueryType . ISSUES_BY_TAG ,
2326 queryInfo : {
@@ -54,11 +57,12 @@ export function TagExportDropdown({tagKey, group, organization, project}: Props)
5457 } ,
5558 {
5659 key : 'export-all' ,
57- label : isExportWorking ? t ( 'Export in progress...' ) : t ( 'Export All to CSV' ) ,
60+ label : isExportDisabled ? t ( 'Export in progress...' ) : t ( 'Export All to CSV' ) ,
5861 onAction : ( ) => {
59- void runExport ( ) ;
62+ handleDataExport ( ) ;
63+ setIsExportDisabled ( true ) ;
6064 } ,
61- disabled : isExportWorking || ! hasDiscoverQuery ,
65+ disabled : isExportDisabled || ! hasDiscoverQuery ,
6266 tooltip : hasDiscoverQuery
6367 ? undefined
6468 : t ( 'This feature is not available for your organization' ) ,
0 commit comments