Skip to content

Commit

Permalink
feat(query-builder): Add empty state for the full-width menu
Browse files Browse the repository at this point in the history
  • Loading branch information
malwilley committed Sep 20, 2024
1 parent f68f0d0 commit 40a39b1
Showing 1 changed file with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,20 @@ function FilterKeyMenuContent<T extends SelectOptionOrSectionWithKey<string>>({
</SectionedListBoxPane>
{showDetailsPane ? (
<DetailsPane>
{focusedKey ? <KeyDescription size="md" tag={focusedKey} /> : null}
{focusedKey ? (
<KeyDescription size="md" tag={focusedKey} />
) : (
<EmptyState>
<div>
<p>{t('No filter selected.')}</p>
<p>
{t(
'Hover over a filter from the list on the left to see more details.'
)}
</p>
</div>
</EmptyState>
)}
</DetailsPane>
) : null}
<FeedbackFooter />
Expand Down Expand Up @@ -457,3 +470,18 @@ const StyledPositionWrapper = styled('div')<{visible?: boolean}>`
display: ${p => (p.visible ? 'block' : 'none')};
z-index: ${p => p.theme.zIndex.tooltip};
`;

const EmptyState = styled('div')`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
padding: ${space(4)};
text-align: center;
color: ${p => p.theme.subText};
div {
max-width: 280px;
}
`;

0 comments on commit 40a39b1

Please sign in to comment.