Files
supabase/apps/studio/components/ui/ButtonTooltip.tsx
T
Ivan VasilovandJoshen Lim 6a29cd2bec feat: Choose which schemas to share with OpenAI (#28594)
* Change the getEntityDefinitions query to accept list of schemas instead of being hardcoded to public schema.

* Add a schema combo box for selecting schemas.

* Use the combobox in the SQL editor to select which schemas should be sent to the AI when asking a question.

* Add configurable schemas to AiPolicyEditor.

* Remove unneeded hook.

* Fix the AI settings modal.

* Add keys to the entity definitions query.

* Fix the AI settings modal which is used by cmdk flow.

* Minor fixes.

* Address feedback

* Some fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-08-15 14:38:19 +08:00

31 lines
1003 B
TypeScript

import { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, ReactNode } from 'react'
import { Button, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_, Tooltip_Shadcn_, cn } from 'ui'
export const ButtonTooltip = forwardRef<
ElementRef<typeof Button>,
ComponentPropsWithoutRef<typeof Button> & {
tooltip: {
content: ComponentProps<typeof TooltipContent_Shadcn_> & {
text?: string | ReactNode
}
}
}
>(({ ...props }, ref) => {
return (
<Tooltip_Shadcn_>
<TooltipTrigger_Shadcn_ asChild>
<Button ref={ref} {...props} className={cn(props.className, 'pointer-events-auto')}>
{props.children}
</Button>
</TooltipTrigger_Shadcn_>
{props.disabled && props.tooltip.content.text !== undefined && (
<TooltipContent_Shadcn_ {...props.tooltip.content}>
{props.tooltip.content.text}
</TooltipContent_Shadcn_>
)}
</Tooltip_Shadcn_>
)
})
ButtonTooltip.displayName = 'ButtonTooltip'