import React from 'react'; import { Dropdown } from 'react-bootstrap'; import type { IInstance } from '../../domain'; import { logger } from '../../utils'; export interface Insight { label: string; url: string; } export interface IInstanceInsightsProps { analytics?: boolean; insights: Insight[]; instance: IInstance; title?: string; } export const InstanceInsights = ({ analytics, insights, instance, title }: IInstanceInsightsProps) => { const logClickEvent = (label: string) => { logger.log({ category: 'Insight Menu (Instance)', action: `${label} clicked`, data: { label: `${instance.account}/${instance.region}/${instance.name}/${instance.serverGroup}` }, }); }; if (!insights?.length) { return null; } return (
{title || 'Insight'} {insights.map((insight) => (
  • (analytics ? logClickEvent(insight.label) : null)} > {insight.label}
  • ))}
    ); };