import * as React from 'react' import './ModalNavigation.css' export type ModalNavigationProps = { /** The modal's title. */ title: React.ReactNode /** modal's subtitle, optional */ subtitle?: React.ReactNode /** ON BACK: on back event, this allows navigation inside modal and renders a button arrow */ onBack?: (event: React.MouseEvent) => void /** ON CLOSE: on clse event, this allows closing the modal rendering a close button */ onClose?: (event: React.MouseEvent) => void /** ON INFO: on info event, this renders a clickable question mark */ onInfo?: (event: React.MouseEvent) => void } export class ModalNavigation extends React.PureComponent { render(): JSX.Element { const { title, subtitle, onBack, onClose, onInfo } = this.props return (
{title}
{subtitle && (
{subtitle}
)} {onBack && (
)} {onInfo && (
)} {onClose && (
)}
) } }