mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
16 lines
638 B
TypeScript
16 lines
638 B
TypeScript
import { Tab, TabProps } from '@grafana/ui/src/components/Tabs/Tab';
|
|
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
|
|
import React, { FC } from 'react';
|
|
import { usePanelCombinedRules } from './hooks/usePanelCombinedRules';
|
|
|
|
interface Props extends Omit<TabProps, 'counter' | 'ref'> {
|
|
panel: PanelModel;
|
|
dashboard: DashboardModel;
|
|
}
|
|
|
|
// it will load rule count from backend
|
|
export const PanelAlertTab: FC<Props> = ({ panel, dashboard, ...otherProps }) => {
|
|
const { rules, loading } = usePanelCombinedRules({ panel, dashboard });
|
|
return <Tab {...otherProps} counter={loading ? null : rules.length} />;
|
|
};
|