Chore/add copy error button (#34700)

Add copy error button to SQL Editor
This commit is contained in:
Terry Sutton authored and GitHub committed 2025-04-04 14:41:02 -02:30
1 parent 79fbd57726
commit d69fbfa703
1 file changed
+12 -1
@@ -4,11 +4,12 @@ import { forwardRef } from 'react'
import { useParams } from 'common'
import { subscriptionHasHipaaAddon } from 'components/interfaces/Billing/Subscription/Subscription.utils'
import CopyButton from 'components/ui/CopyButton'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { AiIconAnimation, Button } from 'ui'
import { AiIconAnimation, Button, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import Results from './Results'
export type UtilityTabResultsProps = {
@@ -137,6 +138,16 @@ const UtilityTabResults = forwardRef<HTMLDivElement, UtilityTabResultsProps>(
Switch to primary database
</Button>
)}
{formattedError.length > 0 && (
<Tooltip>
<TooltipTrigger>
<CopyButton iconOnly type="default" text={formattedError.join('\n')} />
</TooltipTrigger>
<TooltipContent side="bottom" align="center">
<span>Copy error</span>
</TooltipContent>
</Tooltip>
)}
{!hasHipaaAddon && (
<Button
icon={<AiIconAnimation className="scale-75 w-3 h-3" loading={isDebugging} />}