Check for empty costs array and allow title override
Signed-off-by: Jen Evans <jenevan@rei.com>
This commit is contained in:
@@ -37,6 +37,7 @@ type CostInsightsLayoutProps = {
|
||||
};
|
||||
|
||||
export const CostInsightsLayout = ({
|
||||
title = 'Cost Insights',
|
||||
groups,
|
||||
children,
|
||||
}: PropsWithChildren<CostInsightsLayoutProps>) => {
|
||||
@@ -46,7 +47,7 @@ export const CostInsightsLayout = ({
|
||||
<Header
|
||||
style={{ boxShadow: 'none' }}
|
||||
title="Cost Insights"
|
||||
pageTitleOverride="Cost Insights"
|
||||
pageTitleOverride={title}
|
||||
type="Tool"
|
||||
/>
|
||||
<div className={classes.root}>
|
||||
|
||||
@@ -120,7 +120,7 @@ export const EntityCostsCard = () => {
|
||||
return <MaterialAlert severity="error">{error.message}</MaterialAlert>;
|
||||
}
|
||||
|
||||
if (!dailyCost) {
|
||||
if (!dailyCost || !dailyCost.aggregation.length) {
|
||||
return <MaterialAlert severity="error">No daily costs</MaterialAlert>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user