revite/src/components/common/Tooltip.tsx

20 lines
478 B
TypeScript
Raw Normal View History

2021-06-19 13:46:05 -04:00
import { Children } from "../../types/Preact";
import Tippy, { TippyProps } from '@tippyjs/react';
2021-06-19 13:46:05 -04:00
type Props = Omit<TippyProps, 'children'> & {
2021-06-19 13:46:05 -04:00
children: Children;
content: Children;
}
export default function Tooltip(props: Props) {
const { children, content, ...tippyProps } = props;
2021-06-19 13:46:05 -04:00
return (
<Tippy content={content} {...tippyProps}>
{/*
// @ts-expect-error */}
<div>{ children }</div>
</Tippy>
2021-06-19 13:46:05 -04:00
);
}