Alerting: fix layout with long words / numbers (#49882)

This commit is contained in:
Gilles De Mey 2022-05-31 12:33:43 +02:00 committed by GitHub
parent f69c9bd704
commit e04f84fd1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,15 +34,22 @@ export const AnnotationDetailsField: FC<Props> = ({ annotationKey, value }) => {
const AnnotationValue: FC<Props> = ({ annotationKey, value }) => {
const styles = useStyles(getStyles);
if (wellableAnnotationKeys.includes(annotationKey)) {
return <Well>{value}</Well>;
} else if (value && value.startsWith('http')) {
const needsWell = wellableAnnotationKeys.includes(annotationKey);
const needsLink = value && value.startsWith('http');
if (needsWell) {
return <Well className={styles.well}>{value}</Well>;
}
if (needsLink) {
return (
<a href={value} target="__blank" className={styles.link}>
{value}
</a>
);
}
return <>{value}</>;
};