-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathLineageControlButton.tsx
More file actions
43 lines (41 loc) · 1.04 KB
/
LineageControlButton.tsx
File metadata and controls
43 lines (41 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { ControlButton } from '@xyflow/react'
import { cn } from '@/utils'
import { Tooltip } from '../Tooltip/Tooltip'
export function LineageControlButton({
text,
onClick,
disabled = false,
className,
children,
}: {
text: string
children: React.ReactNode
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void
disabled?: boolean
className?: string
}) {
return (
<Tooltip
side="left"
sideOffset={8}
delayDuration={0}
className="px-2 py-1 text-xs rounded-sm font-semibold bg-lineage-control-button-tooltip-background text-lineage-control-button-tooltip-foreground"
trigger={
<div data-component="LineageControlButton">
<ControlButton
onClick={onClick}
className={cn(
'p-0 !bg-lineage-control-background hover:!bg-lineage-control-background-hover',
className,
)}
disabled={disabled}
>
{children}
</ControlButton>
</div>
}
>
{text}
</Tooltip>
)
}