import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from 'ui' import { InlineLink } from '@/components/ui/InlineLink' import { DOCS_URL } from '@/lib/constants' interface RLSToggleDialogProps { open: boolean tableName?: string isEnabled: boolean isSubmitting?: boolean onOpenChange: (open: boolean) => void onConfirm: () => void | Promise } export function RLSToggleDialog({ open, isEnabled, isSubmitting = false, onOpenChange, onConfirm, }: RLSToggleDialogProps) { return ( {isEnabled ? 'Disable Row Level Security' : 'Enable Row Level Security'} {isEnabled ? ( <> This table will become publicly readable and writable.{' '} Anyone can view, add, update, or delete data in this table , and existing RLS policies will no longer apply. ) : ( 'RLS restricts table access until policies allow a request. Existing queries may stop returning rows until policies are added.' )}{' '} Learn more . Cancel onConfirm()} > {isEnabled ? 'Disable RLS' : 'Enable RLS'} ) }