{title}
{children &&
{children}
}
{/* If onRemove is specified, giving preference to onRemove */}
{onRemove ? (
) : onButtonClick ? (
) : null}
);
}
);
Alert.displayName = 'Alert';
const getStyles = (theme: GrafanaTheme, severity: AlertVariant, outline: boolean) => {
const { white } = theme.palette;
const severityColors = getColorsFromSeverity(severity, theme);
const background = css`
background: linear-gradient(90deg, ${severityColors[0]}, ${severityColors[0]});
`;
return {
alert: css`
flex-grow: 1;
padding: 15px 20px;
margin-bottom: ${theme.spacing.xs};
position: relative;
color: ${white};
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
border-radius: ${theme.border.radius.md};
display: flex;
flex-direction: row;
align-items: center;
${background}
`,
icon: css`
padding: 0 ${theme.spacing.md} 0 0;
display: flex;
align-items: center;
justify-content: center;
width: 35px;
`,
title: css`
font-weight: ${theme.typography.weight.semibold};
`,
body: css`
flex-grow: 1;
margin: 0 ${theme.spacing.md} 0 0;
overflow-wrap: break-word;
word-break: break-word;
a {
color: ${white};
text-decoration: underline;
}
`,
close: css`
background: none;
display: flex;
align-items: center;
border: ${outline ? `1px solid ${white}` : 'none'};
border-radius: ${theme.border.radius.sm};
`,
};
};