import classNames from 'classnames'; import React, { FC, ReactType, ReactNode } from 'react'; import style from './index.module.css'; export interface TextWithImageProps { Image?: ReactType; ImageProps?: unknown; title: string; text?: ReactNode; imagePosition?: string; } const TextWithImage: FC = ({ Image, ImageProps = {}, imagePosition = 'Left', title, text, }) => { const textWithImageClassNames = classNames(style.textWithImage, { [`${style[`textWithImage${`Image${imagePosition || 'Left'}`}`]}`]: imagePosition || 'Left', }); return (
{Image && ImageProps && }

{title}

{text && (
{text &&
{text}
}
)}
); }; export default TextWithImage;