diff --git a/frontend/features/verification/components/steps/SPVPrivacyStep.tsx b/frontend/features/verification/components/steps/SPVPrivacyStep.tsx index e508f00..b8d2b8a 100644 --- a/frontend/features/verification/components/steps/SPVPrivacyStep.tsx +++ b/frontend/features/verification/components/steps/SPVPrivacyStep.tsx @@ -1,97 +1,56 @@ +// frontend/features/verification/components/steps/SPVPrivacyStep.tsx + import React from 'react'; -import * as Tooltip from '@radix-ui/react-tooltip'; -import { Info } from 'lucide-react'; -import { useWizardStore } from '../../store/wizard.store'; -import clsx from 'clsx'; -const SPVPrivacyStep = () => { - const { formData, setEncryptionEnabled } = useWizardStore(); - - // Default to true as defined in your defaultContent store configuration - const isEncrypted = formData.content?.encryptionEnabled ?? true; +export const SPVPrivacyStep = ({ formData, setFormData }) => { + const handlePrivacyToggle = (mode: 'public' | 'kms') => { + if (mode === 'public') { + // 🎯 Fix: Explicitly clear KMS specific settings when switching to Public + setFormData((prev) => ({ + ...prev, + privacyMode: 'public', + kmsProvider: '', + kmsKeyId: '', + kmsRegion: '', + })); + } else { + setFormData((prev) => ({ + ...prev, + privacyMode: 'kms', + })); + } + }; return ( -
-
-

Privacy Options

-

- Select how your verification data is handled on the Stellar network. -

-
- - -
- - {/* Public Option (Encryption Disabled) */} -
setEncryptionEnabled(false)} - onKeyDown={(e) => e.key === 'Enter' && setEncryptionEnabled(false)} - className={clsx( - "relative flex flex-1 cursor-pointer flex-col gap-2 rounded-xl border p-4 transition-all hover:border-blue-500 hover:bg-blue-50/50", - !isEncrypted ? "border-blue-500 bg-blue-50 ring-1 ring-blue-500" : "border-gray-200" - )} - > -
- Public - - - - - - - Data is stored plainly on the ledger. Best for standard verifications where transparency is preferred. - - - - -
-

Standard transparent verification

-
- - {/* KMS Encrypted Option (Encryption Enabled) */} -
setEncryptionEnabled(true)} - onKeyDown={(e) => e.key === 'Enter' && setEncryptionEnabled(true)} - className={clsx( - "relative flex flex-1 cursor-pointer flex-col gap-2 rounded-xl border p-4 transition-all hover:border-blue-500 hover:bg-blue-50/50", - isEncrypted ? "border-blue-500 bg-blue-50 ring-1 ring-blue-500" : "border-gray-200" - )} - > -
- KMS Encrypted - - - - - - - Payloads are secured via Key Management Service before broadcasting. Required for sensitive transit permits. - - - - -
-

Maximum security for sensitive data

-
+
+ {/* Example Toggle UI */} + + + {/* KMS Settings conditionally rendered */} + {formData.privacyMode === 'kms' && ( +
+ {/* KMS Inputs here */}
- + )}
); }; - -export default SPVPrivacyStep; \ No newline at end of file