import { useEffect } from 'react' import { Card, CardContent, CardFooter, Form } from 'ui' import { AIOptInLevelSelector } from './AIOptInLevelSelector' import { FormActions } from '@/components/ui/Forms/FormActions' import { useAIOptInForm } from '@/hooks/forms/useAIOptInForm' import { FGA_PERMISSIONS, useAsyncCheckPermissionsV2 } from '@/hooks/misc/useCheckPermissionsV2' export const DataPrivacyForm = () => { const { form, onSubmit, isUpdating, currentOptInLevel } = useAIOptInForm() const { can: canUpdateOrganization } = useAsyncCheckPermissionsV2( FGA_PERMISSIONS.ORGANIZATION.ADMIN_WRITE ) const permissionsHelperText = !canUpdateOrganization ? "You need additional permissions to manage this organization's settings" : undefined useEffect(() => { form.reset({ aiOptInLevel: currentOptInLevel }) }, [currentOptInLevel, form]) return (
) }