import { FC } from 'react'; import InformationBoxTitle from '../information-box-title/information-box-title'; import { ElementContent, withStaticProps } from '../../types'; import { LinkTarget } from '../link/LinkConstants'; import styles from './information-box.module.scss'; type InformationBoxProps = { component?: ElementContent; title?: ElementContent; description?: string; href?: string; linkTarget?: LinkTarget; }; const InformationBox: FC & { linkTargets?: typeof LinkTarget } = ({ component = null, title = '', description = '', href, linkTarget, }) => { const overrideTitle = typeof title === 'string' ? ( {title} ) : ( title ); return (
{component &&
{component}
} {overrideTitle}
{description}
); }; export default withStaticProps(InformationBox, { linkTargets: LinkTarget });