mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 01:13:55 +00:00
1849b4d39f
* chore: migrate eslint to oxlint * chore: migrate prettier to oxfmt * chore: migrate typescript * chore: toThrow should have a expected value * chore: cast test value as Day * chore: small title fix * chore: mocks should be hoisted * chore: incorrect async useage * chore: test should be inside description * chore: test sohuld include an expeced * chore: oxfmt --------- Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
25 lines
769 B
TypeScript
25 lines
769 B
TypeScript
import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
|
|
import { PropsWithChildren } from 'react';
|
|
|
|
import style from './Tooltip.module.scss';
|
|
|
|
interface TooltipProps extends BaseTooltip.Trigger.Props {
|
|
text: string;
|
|
}
|
|
|
|
export default function Tooltip({ text, children, ...triggerProps }: PropsWithChildren<TooltipProps>) {
|
|
return (
|
|
<BaseTooltip.Root>
|
|
<BaseTooltip.Trigger {...triggerProps}>{children}</BaseTooltip.Trigger>
|
|
<BaseTooltip.Portal>
|
|
<BaseTooltip.Positioner side='bottom' sideOffset={4}>
|
|
<BaseTooltip.Popup className={style.tooltip}>
|
|
<BaseTooltip.Arrow />
|
|
{text}
|
|
</BaseTooltip.Popup>
|
|
</BaseTooltip.Positioner>
|
|
</BaseTooltip.Portal>
|
|
</BaseTooltip.Root>
|
|
);
|
|
}
|