Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Sep 21, 2020
1 parent fe6870b commit 2318ab6
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ import { ChartWrapper } from '../ChartWrapper';
import { I18LABELS } from '../translations';

interface Props {
data?: Array<Record<string, number | null>>;
data?: {
topItems: string[];
items: Array<Record<string, number | null>>;
};
loading: boolean;
}

Expand Down Expand Up @@ -68,8 +71,7 @@ export function PageViewsChart({ data, loading }: Props) {
});
};

const breakdownAccessors =
data?.topItems?.length > 0 ? data?.topItems : ['y'];
const breakdownAccessors = data?.topItems?.length ? data?.topItems : ['y'];

const [darkMode] = useUiSetting$<boolean>('theme:darkMode');

Expand Down

0 comments on commit 2318ab6

Please sign in to comment.