diff --git a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx index 1620dfca4..b1d84f54e 100644 --- a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx +++ b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx @@ -8,7 +8,7 @@ import AddPredefinedMetric from './AddPredefinedMetric'; import cn from 'classnames'; interface AddMetricButtonProps { - iconName: string; + iconName: "bar-pencil" | "grid-check"; title: string; description: string; isPremade?: boolean; @@ -49,8 +49,8 @@ function AddMetricButton({ iconName, title, description, onClick, isPremade, isP interface Props { siteId: string - isPopup: boolean - onAction: () => void + isPopup?: boolean + onAction?: () => void } function AddMetricContainer({ siteId, isPopup, onAction }: Props) { @@ -58,7 +58,7 @@ function AddMetricContainer({ siteId, isPopup, onAction }: Props) { const { dashboardStore } = useStore(); const onAddCustomMetrics = () => { - onAction() + onAction?.() dashboardStore.initDashboard(dashboardStore.selectedDashboard); showModal( { - onAction() + onAction?.() dashboardStore.initDashboard(dashboardStore.selectedDashboard); showModal(