Skip to content

Commit

Permalink
Fix use of useIsEsqlMode in embeddable code
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee committed May 13, 2024
1 parent 2bff126 commit e4d4031
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
*/

import React from 'react';
import { AggregateQuery, Query } from '@kbn/es-query';
import { AggregateQuery, isOfAggregateQueryType, Query } from '@kbn/es-query';
import { DataLoadingState } from '@kbn/unified-data-table';
import { DiscoverGridEmbeddable } from './saved_search_grid';
import { DiscoverDocTableEmbeddable } from '../components/doc_table/create_doc_table_embeddable';
import type { EmbeddableComponentSearchProps } from './types';
import { useIsEsqlMode } from '../application/main/hooks/use_is_esql_mode';

interface SavedSearchEmbeddableComponentProps {
fetchedSampleSize: number;
Expand All @@ -30,14 +29,12 @@ export function SavedSearchEmbeddableComponent({
useLegacyTable,
query,
}: SavedSearchEmbeddableComponentProps) {
const isEsqlMode = useIsEsqlMode();

if (useLegacyTable) {
return (
<DiscoverDocTableEmbeddableMemoized
{...searchProps}
sampleSizeState={fetchedSampleSize}
isEsqlMode={isEsqlMode}
isEsqlMode={isOfAggregateQueryType(query)}
/>
);
}
Expand Down

0 comments on commit e4d4031

Please sign in to comment.