ruvector/studio/components/interfaces/SQLEditor/RunQueryWarningModal.tsx
rUv 814f595995 feat(studio): Add complete RuVector Studio application
Major additions:
- Complete Next.js studio application with 1600+ components
- Docker support (Dockerfile.combined, docker-compose.yml)
- GCP deployment documentation and benchmarks
- SQL benchmark scripts for performance testing
- Sentry integration for monitoring
- Comprehensive test suite and mocks

Studio features:
- Dashboard and admin interfaces
- Data visualization components
- Authentication and user management
- API integration with RuVector backend
- Static data and public assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 23:04:48 +00:00

66 lines
2.2 KiB
TypeScript

import { Separator } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
interface RunQueryWarningModalProps {
visible: boolean
hasDestructiveOperations: boolean
hasUpdateWithoutWhere: boolean
onCancel: () => void
onConfirm: () => void
}
export const RunQueryWarningModal = ({
visible,
hasDestructiveOperations,
hasUpdateWithoutWhere,
onCancel,
onConfirm,
}: RunQueryWarningModalProps) => {
return (
<ConfirmationModal
visible={visible}
size="large"
title={`Potential issue${hasDestructiveOperations && hasUpdateWithoutWhere ? 's' : ''} detected with your query`}
confirmLabel="Run this query"
variant="warning"
alert={{
base: {
variant: 'warning',
},
title:
hasDestructiveOperations && hasUpdateWithoutWhere
? 'The following potential issues have been detected:'
: 'The following potential issue has been detected:',
description: 'Ensure that these are intentional before executing this query',
}}
onCancel={onCancel}
onConfirm={onConfirm}
>
<div className="text-sm">
<ul className="border rounded-md grid bg-surface-200">
{hasDestructiveOperations && (
<li className="grid pt-3 pb-2 px-4">
<span className="font-bold">Query has destructive operation</span>
<span className="text-foreground-lighter">
Make sure you are not accidentally removing something important.
</span>
</li>
)}
{hasDestructiveOperations && hasUpdateWithoutWhere && <Separator />}
{hasUpdateWithoutWhere && (
<li className="grid pt-2 pb-3 px-4 gap-1">
<span className="font-bold">Query uses update without a where clause</span>
<span className="text-foreground-lighter">
Without a <code className="text-code-inline">where</code> clause, this could update
all rows in the table.
</span>
</li>
)}
</ul>
</div>
<p className="mt-4 text-sm text-foreground-light">
Please confirm that you would like to execute this query.
</p>
</ConfirmationModal>
)
}