* Enable @typescript-eslint/consistent-type-imports lint rule This is to help ensure that we get proper vite/rollup lazy loading by not `import`ing more than we need to. Revert "Enable @typescript-eslint/consistent-type-imports lint rule" This reverts commit ba385fa00b7e410cc508fd5fb9fe972233ae114f. Enable @typescript-eslint/consistent-type-imports lint rule This is to help ensure that we get proper vite/rollup lazy loading by not `import`ing more than we need to. . * Format
42 lines
951 B
TypeScript
42 lines
951 B
TypeScript
/*
|
|
Copyright 2024 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
import { type PropsWithChildren, type ReactNode } from "react";
|
|
import classNames from "classnames";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import styles from "./ReactionIndicator.module.css";
|
|
|
|
export function ReactionIndicator({
|
|
emoji,
|
|
miniature,
|
|
children,
|
|
}: PropsWithChildren<{
|
|
miniature?: boolean;
|
|
emoji: string;
|
|
}>): ReactNode {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<div
|
|
className={classNames(styles.reactionIndicatorWidget, {
|
|
[styles.reactionIndicatorWidgetLarge]: !miniature,
|
|
})}
|
|
>
|
|
<div
|
|
className={classNames(styles.reaction, {
|
|
[styles.reactionLarge]: !miniature,
|
|
})}
|
|
>
|
|
<span role="img" aria-label={t("common.reaction")}>
|
|
{emoji}
|
|
</span>
|
|
</div>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|