import * as classNames from "classnames"; import * as React from "react"; import { Link, ILinkProps } from "../Link"; import { Icon, IIconProps } from "../Icon"; export interface IStat { /** * Since we iterate through the provided sections, * we want to provide proper keys to React. */ id: string; text?: string; icon?: IIconProps; link?: ILinkProps; } export interface IStatsProps { stats: IStat[]; } export const Stats = ({ stats }: IStatsProps) => (
{stats.map(({ id, text, icon, link }) => (
{icon && (
)} {(text || link) && (
{link ? : text}
)}
))}
)