/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React, { useCallback } from 'react'; import { i18n } from '@osd/i18n'; import { FormattedMessage } from '@osd/i18n/react'; import produce from 'immer'; import { Draft } from 'immer'; import { EuiIconTip } from '@elastic/eui'; import { NumberInputOption, SwitchOption } from '../../../../../charts/public'; import { useTypedDispatch, useTypedSelector, setStyleState, } from '../../../application/utils/state_management'; import { TableOptionsDefaults } from '../table_viz_type'; import { Option } from '../../../application/app'; function TableVizOptions() { const styleState = useTypedSelector((state) => state.style) as TableOptionsDefaults; const dispatch = useTypedDispatch(); const setOption = useCallback( (callback: (draft: Draft) => void) => { const newState = produce(styleState, callback); dispatch(setStyleState(newState)); }, [dispatch, styleState] ); const isPerPageValid = styleState.perPage === '' || styleState.perPage > 0; return ( <> ); } export { TableVizOptions };