mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
27 lines
737 B
TypeScript
27 lines
737 B
TypeScript
import React, { FC, ReactElement } from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import { Markdown } from '~/components/containers/Markdown';
|
|
import { formatText } from '~/utils/dom';
|
|
import { DivProps } from '~/utils/types';
|
|
|
|
import styles from './styles.module.scss';
|
|
|
|
|
|
interface Props extends DivProps {
|
|
children: string;
|
|
heading: string | ReactElement;
|
|
}
|
|
|
|
const FlowCellText: FC<Props> = ({ children, heading, ...rest }) => (
|
|
<div {...rest} className={classNames(styles.text, rest.className)}>
|
|
{heading && <div className={styles.heading}>{heading}</div>}
|
|
<Markdown
|
|
className={styles.description}
|
|
dangerouslySetInnerHTML={{ __html: formatText(children) }}
|
|
/>
|
|
</div>
|
|
);
|
|
|
|
export { FlowCellText };
|