mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 10:19:08 +00:00
29 lines
859 B
TypeScript
29 lines
859 B
TypeScript
// Copyright 2021 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import React from 'react';
|
|
import type { RenderTextCallbackType } from '../types/Util.std.js';
|
|
import { AddNewLines } from './conversation/AddNewLines.dom.js';
|
|
import { Emojify } from './conversation/Emojify.dom.js';
|
|
import { Linkify } from './conversation/Linkify.dom.js';
|
|
|
|
type PropsType = {
|
|
text: string;
|
|
};
|
|
|
|
const renderNonLink: RenderTextCallbackType = ({ key, text }) => (
|
|
<Emojify key={key} text={text} />
|
|
);
|
|
|
|
const renderNonNewLine: RenderTextCallbackType = ({ key, text }) => (
|
|
<Linkify key={key} text={text} renderNonLink={renderNonLink} />
|
|
);
|
|
|
|
export function GroupDescriptionText({ text }: PropsType): JSX.Element {
|
|
return (
|
|
<div className="GroupDescriptionText">
|
|
<AddNewLines text={text} renderNonNewLine={renderNonNewLine} />
|
|
</div>
|
|
);
|
|
}
|