mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-07-02 03:16:05 +01:00
33 lines
961 B
TypeScript
33 lines
961 B
TypeScript
// Copyright 2021 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { JSX } from 'react';
|
|
|
|
import type { RenderTextCallbackType } from '../types/Util.std.ts';
|
|
import { AddNewLines } from './conversation/AddNewLines.dom.tsx';
|
|
import { Emojify } from './conversation/Emojify.dom.tsx';
|
|
import { Linkify } from './conversation/Linkify.dom.tsx';
|
|
import { tw } from '../axo/tw.dom.tsx';
|
|
|
|
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 (
|
|
<span
|
|
className={tw('select-text [&_a]:text-label-primary [&_a]:underline')}
|
|
>
|
|
<AddNewLines text={text} renderNonNewLine={renderNonNewLine} />
|
|
</span>
|
|
);
|
|
}
|