Add back export all action button (#4750)
 
This commit is contained in:
@ -3,11 +3,13 @@ import { Key } from 'ts-key-enum';
|
||||
import {
|
||||
IconBaselineDensitySmall,
|
||||
IconChevronLeft,
|
||||
IconFileExport,
|
||||
IconFileImport,
|
||||
IconTag,
|
||||
} from 'twenty-ui';
|
||||
|
||||
import { RECORD_INDEX_OPTIONS_DROPDOWN_ID } from '@/object-record/record-index/options/constants/RecordIndexOptionsDropdownId';
|
||||
import { useExportTableData } from '@/object-record/record-index/options/hooks/useExportTableData.ts';
|
||||
import { useRecordIndexOptionsForBoard } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForBoard';
|
||||
import { useRecordIndexOptionsForTable } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForTable';
|
||||
import { TableOptionsHotkeyScope } from '@/object-record/record-table/types/TableOptionsHotkeyScope';
|
||||
@ -97,6 +99,13 @@ export const RecordIndexOptionsDropdownContent = ({
|
||||
const { openRecordSpreadsheetImport } =
|
||||
useSpreadsheetRecordImport(objectNameSingular);
|
||||
|
||||
const { progress, download } = useExportTableData({
|
||||
delayMs: 100,
|
||||
filename: `${objectNameSingular}.csv`,
|
||||
objectNameSingular,
|
||||
recordIndexId,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
{!currentMenu && (
|
||||
@ -111,6 +120,11 @@ export const RecordIndexOptionsDropdownContent = ({
|
||||
LeftIcon={IconFileImport}
|
||||
text="Import"
|
||||
/>
|
||||
<MenuItem
|
||||
onClick={download}
|
||||
LeftIcon={IconFileExport}
|
||||
text={progress === undefined ? `Export` : `Export (${progress}%)`}
|
||||
/>
|
||||
</DropdownMenuItemsContainer>
|
||||
)}
|
||||
{currentMenu === 'fields' && (
|
||||
|
||||
Reference in New Issue
Block a user