mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
17 lines
354 B
TypeScript
17 lines
354 B
TypeScript
import { cx } from '@emotion/css';
|
|
import React from 'react';
|
|
|
|
import { isUrl } from './utils';
|
|
|
|
export const renderValue = (value: string): string | React.ReactNode => {
|
|
if (isUrl(value)) {
|
|
return (
|
|
<a href={value} target={'_blank'} className={cx('external-link')} rel="noreferrer">
|
|
{value}
|
|
</a>
|
|
);
|
|
}
|
|
|
|
return value;
|
|
};
|