import React from 'react'; import { Link } from 'react-router-dom'; interface IStatusInfo { avatarSize: number to?: string icon: React.ReactNode text: React.ReactNode } const StatusInfo = (props: IStatusInfo) => { const { avatarSize, to, icon, text } = props; const onClick = (event: React.MouseEvent) => { event.stopPropagation(); }; const Container = to ? Link : 'div'; const containerProps: any = to ? { onClick, to } : {}; return (
{icon}
{text}
); }; export default StatusInfo;