Skip to content

Commit

Permalink
Utilize EuiEmptyPrompt to represent empty state (#320) (#333)
Browse files Browse the repository at this point in the history
* Utilize EuiEmptyPrompt to represent empty state



* Update icon and text for empty prompts



* Update public/components/query_compare/search_result/result_components/result_components.tsx




---------



(cherry picked from commit 53d6fe3)

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
  • Loading branch information
3 people authored Oct 17, 2023
1 parent 6340a68 commit b545efc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import React, { useEffect, useState } from 'react';
import { EuiSplitPanel, EuiTitle, EuiFlexGroup, EuiPanel } from '@elastic/eui';
import { EuiSplitPanel, EuiEmptyPrompt, EuiPanel } from '@elastic/eui';

import { QueryError, SearchResults } from '../../../../types/index';
import { ResultPanel } from './result_panel';
Expand All @@ -26,11 +26,13 @@ const InitialState = () => {
grow={true}
style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}
>
<EuiFlexGroup justifyContent="center">
<EuiTitle>
<h2>Add queries to compare search results.</h2>
</EuiTitle>
</EuiFlexGroup>
<EuiEmptyPrompt
iconType="search"
title={<h2>No results</h2>}
body={
<p>Add at least one query to display search results.</p>
}
/>
</EuiPanel>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiHorizontalRule,
EuiEmptyPrompt,
} from '@elastic/eui';

import { ResultGridComponent } from './result_grid';
Expand Down Expand Up @@ -70,7 +71,15 @@ export const ResultPanel = ({ resultNumber, queryResult, queryError }: ResultPan
) : (
<>
<EuiHorizontalRule margin="s" />
<EuiText>No results.</EuiText>
<EuiEmptyPrompt
iconType="search"
title={<h2>No results</h2>}
body={
<>
<p>Add a second query to display search comparison results.</p>
</>
}
/>
</>
)}
</EuiSplitPanel.Inner>
Expand Down

0 comments on commit b545efc

Please sign in to comment.