mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
19 lines
547 B
TypeScript
19 lines
547 B
TypeScript
import { RenderTextCallbackType } from '../../types/Util';
|
|
|
|
type Props = {
|
|
text: string;
|
|
/** Allows you to customize now non-newlines are rendered. Simplest is just a <span>. */
|
|
renderNonNewLine: RenderTextCallbackType;
|
|
isGroup: boolean;
|
|
isPublic: boolean;
|
|
};
|
|
|
|
export const AddNewLines = (props: Props) => {
|
|
const { text, renderNonNewLine, isGroup, isPublic } = props;
|
|
const rendered = renderNonNewLine({ text, key: 0, isGroup, isPublic });
|
|
if (typeof rendered === 'string') {
|
|
return <>{rendered}</>;
|
|
}
|
|
return rendered;
|
|
};
|