import React from 'react'; import { Link } from '@tutorbook/intl'; import styles from './title.module.scss'; interface ActionButtonProps { label: string; onClick: () => void; } function ActionButton({ label, onClick }: ActionButtonProps): JSX.Element { return ( {label} ); } interface ActionLinkProps { label: string; href: string; as: string; } function ActionLink({ label, href, as }: ActionLinkProps): JSX.Element { return ( /* eslint-disable jsx-a11y/anchor-is-valid */ {label} /* eslint-enable jsx-a11y/anchor-is-valid */ ); } interface ActionProps { label: string; href?: string; as?: string; onClick?: () => void; } function Action({ label, href, as, onClick }: ActionProps): JSX.Element { if (href && as) return ; return {})} />; } interface TitleProps { header: string; body: string; actions?: ActionProps[]; } export default function Title({ header, body, actions, }: TitleProps): JSX.Element { return ( {header} {body} {actions && actions.length && ( {actions.map((props: ActionProps) => ( ))} )} ); }
{body}