import React from 'react'; import { JobInsightsInfo, getInsightList } from '@bundle-stats/utils'; import { FlexStack } from '../../layout/flex-stack'; import { Stack } from '../../layout/stack'; import { ComponentLink } from '../component-link'; import { InsightIcon } from '../insight-icon'; import css from './insights.module.css'; interface InsightsProps extends React.HTMLAttributes { insights: JobInsightsInfo; customComponentLink?: React.ElementType; } export const Insights = (props: InsightsProps) => { const { insights, customComponentLink: CustomComponentLink = ComponentLink, ...restProps } = props; const insightList = getInsightList(insights); return ( {insightList.map(({ name, insight, link }) => { const { text } = insight.data as { text: string }; return ( {text} ); })} ); };