Files
supabase/packages/ui-patterns/info-tooltip.tsx
Joshen Lim d586346e27 Chore/sentry fixes 211024 (#30003)
* Resolve https://supabase.sentry.io/issues/5808689343

* Fix SecurityStatus map key prop issue

* Fix FileExplorerHeader to use ButtonTooltip

* Fix https://supabase.sentry.io/issues/5998687405

* Fix https://supabase.sentry.io/issues/5414129652

* Fix https://supabase.sentry.io/issues/5414129652

* Fix map key issue in QueryPerformanceGrid

* Add whitelist error for sign up mutation

* Fix map key in DiskUsage

* Fix prop name in info-tooltip
2024-10-22 15:21:06 +08:00

39 lines
1.2 KiB
TypeScript

import { ElementRef, forwardRef } from 'react'
import { TooltipContent_Shadcn_, TooltipTrigger_Shadcn_, Tooltip_Shadcn_ } from 'ui'
const SVG = forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>((props, ref) => (
<svg
ref={ref}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
{...props}
>
<path
d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z"
fillRule="evenodd"
clipRule="evenodd"
/>
</svg>
))
const InfoTooltip = forwardRef<
ElementRef<typeof TooltipContent_Shadcn_>,
React.ComponentPropsWithoutRef<typeof TooltipContent_Shadcn_>
>(({ ...props }, ref) => {
return (
<Tooltip_Shadcn_>
<TooltipTrigger_Shadcn_
type="button"
role="button"
className="flex [&_svg]:data-[state=delayed-open]:fill-foreground-lighter [&_svg]:data-[state=instant-open]:fill-foreground-lighter"
>
<SVG strokeWidth={2} className="transition-colors fill-foreground-muted w-4 h-4" />
</TooltipTrigger_Shadcn_>
<TooltipContent_Shadcn_ {...props} />
</Tooltip_Shadcn_>
)
})
export { InfoTooltip }