import * as React from 'react' ; import { Widget , WidgetBody } from '../widget' ; import Icon from '../Icon' ; import Text from '../Text' ; import styles from './InfoPanel.module.scss' ; interface Props { onClick ? : ( event : React . MouseEvent | Event ) => void ; title : string ; mode ? : 'dark' | 'light' ; } const InfoPanel = props => ( < Widget > < WidgetBody size = { 'xs' } mode = { props . mode } > < div className = { styles . infoHeading } > < Text type = "tr" color = "platinum_gray" > { props . title } < /Text> { props . onClick && ( < a href = "#" onClick = { props . onClick } > < Icon size = { 'l' } name = { 'chevron_right' } > chevron_right < /Icon> < /a>)} < /div> < div > { props . children } < /div> < /WidgetBody> < /Widget>); export default InfoPanel ;