import { css } from '@emotion/css'; import DangerouslySetHtmlContent from 'dangerously-set-html-content'; import React from 'react'; import { GrafanaTheme2, renderMarkdown } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; import { Message } from './types'; type Props = { message: Message; }; export const Comment = ({ message }: Props) => { const styles = useStyles2(getStyles); let senderColor = '#34BA18'; let senderName = 'System'; let avatarUrl = '/public/img/grafana_icon.svg'; if (message.userId > 0) { senderColor = '#19a2e7'; senderName = message.user.login; avatarUrl = message.user.avatarUrl; } const timeColor = '#898989'; const timeFormatted = new Date(message.created * 1000).toLocaleTimeString(); const markdownContent = renderMarkdown(message.content, { breaks: true }); return (