import { ExportState, FiltersMap, SelectedExportOption } from '@wix/bex-core'; import { Box, RadioGroup, Text } from '@wix/design-system'; import React from 'react'; import { observer } from 'mobx-react-lite'; import { useToolbarCollectionContext } from '../ToolbarCollectionContext'; import { RadioGroupSafe } from './RadioGroupSafe'; export interface ExportStepConfigProps { state: ExportState; exportToCSVMessage?: string; } function _ExportStepConfig({ state, exportToCSVMessage, }: ExportStepConfigProps) { const { selectedExportOption, disabledRadios, totalForExportMap, translate: t, } = state; const table = useToolbarCollectionContext(); return ( state.onExportTypeChange(val as SelectedExportOption) } value={selectedExportOption} disabledRadios={disabledRadios} > {t('cairo.export.allItems')} {t('cairo.export.filteredItems')}{' '} {disabledRadios.indexOf('filtered') === -1 ? totalForExportMap.filtered != null && `(${totalForExportMap.filtered})` : '(0)'} {table.selectionProps.value.showSelection && ( {t('cairo.export.selectedItems')}{' '} {disabledRadios.indexOf('selected') === -1 ? totalForExportMap.selected != null && `(${totalForExportMap.selected})` : '(0)'} )} {exportToCSVMessage || t('cairo.export.exportToCSVMessage')} ); } export const ExportStepConfig = observer(_ExportStepConfig);