* Update all non-major dependencies * Delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Prettier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
31 lines
881 B
TypeScript
31 lines
881 B
TypeScript
/*
|
|
Copyright 2019-2024 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React, { type HTMLAttributes } from "react";
|
|
import { Tooltip } from "@vector-im/compound-web";
|
|
|
|
interface IProps extends HTMLAttributes<HTMLSpanElement> {
|
|
tooltip: string;
|
|
tooltipProps?: {
|
|
tabIndex?: number;
|
|
};
|
|
}
|
|
|
|
export default class TextWithTooltip extends React.Component<IProps> {
|
|
public render(): React.ReactNode {
|
|
const { className, children, tooltip, tooltipProps } = this.props;
|
|
|
|
return (
|
|
<Tooltip label={tooltip} placement="right">
|
|
<span className={className} tabIndex={tooltipProps?.tabIndex ?? 0}>
|
|
{children}
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
}
|
|
}
|