Files
redash/client/app/components/Tooltip.tsx
Rafael Wendel d8d7c78992 Replace <a> and <button> with <PlainButton> (#5433)
* Add PlainButton

* refactor close icons

* reorder import

* refactor remaining anchors

* refactor: replace remaining <button> and TODOs

* refactor: changed applicable elements to type link

* fix: minor details

* bug: fix tooltip ternary

* refactor: improve interactivity and semantics of schema list item
2021-04-10 16:43:58 -03:00

14 lines
433 B
TypeScript

import React from "react";
import AntTooltip, { TooltipProps } from "antd/lib/tooltip";
import { isNil } from "lodash";
export default function Tooltip({ title, ...restProps }: TooltipProps) {
const liveTitle = !isNil(title) ? (
<span role="status" aria-live="assertive" aria-relevant="additions">
{title}
</span>
) : null;
return <AntTooltip trigger={["hover", "focus"]} title={liveTitle} {...restProps} />;
}