// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import classNames from 'classnames';
import type { KeyboardEventHandler } from 'react';
import React from 'react';
import { Emojify } from './Emojify';
export function AtMention({
direction,
id,
isInvisible,
isStrikethrough,
name,
onClick,
onKeyUp,
}: {
direction: 'incoming' | 'outgoing' | undefined;
id: string;
isInvisible: boolean;
isStrikethrough?: boolean;
name: string;
onClick: () => void;
onKeyUp: KeyboardEventHandler;
}): JSX.Element {
const textElement = (
<>
@
>
);
const formattedTextElement = isStrikethrough ? (
{textElement}
) : (
textElement
);
if (isInvisible) {
return (
{formattedTextElement}
);
}
return (
{formattedTextElement}
);
}