* feat(tracker) start message buffering support * feat(tracker): buffered recordings * feat(tracker): buffered recordings timedelay adjust * fix(tracker): condition manager * fix(tracker): conditions handlers * fix(tracker): conditions * fix(tracker): pre-fetch feature flags and conditions, fix naming and dnt check repeating * fix(tracker): fix conditions fetch * feat(tracker): test coverage for conditionsManager * feat(tracker): some api connections * feat(tracker): fix projid in session info * feat(tracker): added fetch req status condition, partially added offline recording, type fixes * fix(tracker): fix tests * fix(tracker): fix network req c * fix(tracker): fix conditions test * feat(ui): conditional recording ui * fix(tracker): fix prestart callbacks * feat(ui): conditions ui and api stuff * feat(ui): fix ? * fix(tracker): map raw db response in tracker * fix(tracker): fix condition processing, add cond name to trigger event, change unit tests * fix(tracker): simplify mapping, rename functions * fix(tracker): change toggler design, change network request condition * fix(tracker): some formatting * fix(tracker): reformat logging * fix(ui): rm console log
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import { useTooltipState, TooltipAnchor, FloatingTooltip } from './FloatingTooltip';
|
|
import type { Placement } from '@floating-ui/react-dom-interactions';
|
|
import cn from 'classnames';
|
|
|
|
interface Props {
|
|
title?: React.ReactNode;
|
|
children: React.ReactNode;
|
|
disabled?: boolean;
|
|
open?: boolean;
|
|
placement?: Placement;
|
|
className?: string;
|
|
delay?: number;
|
|
style?: any;
|
|
offset?: number;
|
|
anchorClassName?: string;
|
|
}
|
|
function Tooltip(props: Props) {
|
|
const {
|
|
title,
|
|
disabled = false,
|
|
open = false,
|
|
placement,
|
|
className = '',
|
|
anchorClassName = '',
|
|
containerClassName = '',
|
|
delay = 500,
|
|
style = {},
|
|
offset = 5,
|
|
} = props;
|
|
const arrowRef = React.useRef(null);
|
|
|
|
const state = useTooltipState({
|
|
disabled: disabled,
|
|
placement,
|
|
delay,
|
|
initialOpen: open,
|
|
offset,
|
|
arrowRef,
|
|
});
|
|
|
|
return (
|
|
<div className={cn("relative", containerClassName)}>
|
|
<TooltipAnchor className={anchorClassName} state={state}>{props.children}</TooltipAnchor>
|
|
<FloatingTooltip
|
|
state={state}
|
|
className={cn('bg-gray-darkest color-white rounded py-1 px-2 animate-fade whitespace-pre-wrap', className)}
|
|
>
|
|
{title}
|
|
{/* <FloatingArrow state={state} className="" /> */}
|
|
</FloatingTooltip>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Tooltip;
|