grafana/public/app/features/alerting/unified/AlertWarning.tsx
Leo 4eea5d5190
Navigation: Use navid and pagnav in alert rules pages (#55722)
* add navid and pagenav to edit/add/view alert rules

* move ruleeditor smaller component to its own file

* fix form alignments with new layout

* fixed broken test

* reuse AlertingPageWrapper
2022-10-04 14:36:36 +02:00

25 lines
643 B
TypeScript

import { css } from '@emotion/css';
import React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { Alert, LinkButton, useStyles2 } from '@grafana/ui';
interface AlertWarningProps {
title: string;
children: React.ReactNode;
}
export function AlertWarning({ title, children }: AlertWarningProps) {
return (
<Alert className={useStyles2(warningStyles).warning} severity="warning" title={title}>
<p>{children}</p>
<LinkButton href="alerting/list">To rule list</LinkButton>
</Alert>
);
}
const warningStyles = (theme: GrafanaTheme2) => ({
warning: css`
margin: ${theme.spacing(4)};
`,
});