/** * Generate Key Panel - Standard SSH Key generation form */ import { Eye, EyeOff } from 'lucide-react'; import React from 'react'; import { useI18n } from '../../application/i18n/I18nProvider'; import { cn } from '../../lib/utils'; import { KeyType, SSHKey } from '../../types'; import { Button } from '../ui/button'; import { Input } from '../ui/input'; import { Label } from '../ui/label'; interface GenerateStandardPanelProps { draftKey: Partial; setDraftKey: (key: Partial) => void; showPassphrase: boolean; setShowPassphrase: (show: boolean) => void; isGenerating: boolean; onGenerate: () => void; } export const GenerateStandardPanel: React.FC = ({ draftKey, setDraftKey, showPassphrase, setShowPassphrase, isGenerating, onGenerate, }) => { const { t } = useI18n(); return ( <>
setDraftKey({ ...draftKey, label: e.target.value })} placeholder={t('keychain.generate.labelPlaceholder')} />
{(['ED25519', 'ECDSA', 'RSA'] as KeyType[]).map((t) => ( ))}
{/* Key Size selector - only for RSA and ECDSA */} {(draftKey.type === 'RSA' || draftKey.type === 'ECDSA') && (
{(draftKey.type === 'RSA' ? [4096, 2048, 1024] : [256, 384, 521] ).map((size) => ( ))}
)}
setDraftKey({ ...draftKey, passphrase: e.target.value })} placeholder={t('keychain.generate.passphrasePlaceholder')} className="pr-10" />
setDraftKey({ ...draftKey, savePassphrase: e.target.checked })} className="h-4 w-4 rounded border-border" />
); };