tripnomics_7.5.5/public/app/features/alerting/components/PreviewInstancesTab.tsx
venbatechnologies@gmail.com 91fce5c4bf Initial commit
2021-07-05 13:49:40 +05:30

27 lines
840 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { FC } from 'react';
import { DataFrame } from '@grafana/data';
import { Button, Table } from '@grafana/ui';
import { PreviewStyles } from './AlertingQueryPreview';
interface Props {
instances: DataFrame[];
isTested: boolean;
styles: PreviewStyles;
width: number;
height: number;
onTest: () => void;
}
export const PreviewInstancesTab: FC<Props> = ({ instances, isTested, onTest, height, styles, width }) => {
if (!isTested) {
return (
<div className={styles.noQueries}>
<h4 className={styles.noQueriesHeader}>You havent tested your alert yet.</h4>
<div>In order to see your instances, you need to test your alert first.</div>
<Button onClick={onTest}>Test alert now</Button>
</div>
);
}
return <Table data={instances[0]} height={height} width={width} />;
};