Skip to content

Commit

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

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update icon and text for empty prompts

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

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

Co-authored-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

---------

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
  • Loading branch information
nung22 and joshuarrrr authored Oct 17, 2023
1 parent b9a71a4 commit 53d6fe3
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 53d6fe3

Please sign in to comment.