Skip to content

Commit

Permalink
Conditional rendering sampledatawarning
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Apr 25, 2024
1 parent 83523d6 commit 714d0cf
Showing 1 changed file with 32 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,37 +98,38 @@ const DashboardAWSComponents: React.FC = ({}) => {
)}
{dataSource && results?.hits?.total === 0 ? (
<DiscoverNoResults />
) : (
<SampleDataWarning />
)}
{dataSource && results?.hits?.total > 0 ? (
<div className='aws-dashboard-responsive'>
<DashboardByRenderer
input={{
viewMode: ViewMode.VIEW,
panels: getDashboardPanels(
dataSource?.id,
Boolean(dataSource?.getPinnedAgentFilter()?.length),
),
isFullScreenMode: false,
filters: fetchFilters || [],
useMargins: true,
id: 'aws-dashboard-tab',
timeRange: {
from: dateRangeFrom,
to: dateRangeTo,
},
title: 'AWS dashboard',
description: 'Dashboard of the AWS',
query: query,
refreshConfig: {
pause: false,
value: 15,
},
hidePanelTitles: false,
}}
/>
</div>
) : null}
{!isDataSourceLoading && dataSource && results?.hits?.total > 0 ? (
<>
<SampleDataWarning />
<div className='aws-dashboard-responsive'>
<DashboardByRenderer
input={{
viewMode: ViewMode.VIEW,
panels: getDashboardPanels(
dataSource?.id,
Boolean(dataSource?.getPinnedAgentFilter()?.length),
),
isFullScreenMode: false,
filters: fetchFilters || [],
useMargins: true,
id: 'aws-dashboard-tab',
timeRange: {
from: dateRangeFrom,
to: dateRangeTo,
},
title: 'AWS dashboard',
description: 'Dashboard of the AWS',
query: query,
refreshConfig: {
pause: false,
value: 15,
},
hidePanelTitles: false,
}}
/>
</div>
</>
) : null}
</>
</I18nProvider>
Expand Down

0 comments on commit 714d0cf

Please sign in to comment.