/** * View Key Panel - Display SSH key details */ import { Check, Copy, Info } from 'lucide-react'; import React, { useCallback, useState } from 'react'; import { useI18n } from '../../application/i18n/I18nProvider'; import { SSHKey } from '../../types'; import { Button } from '../ui/button'; import { Label } from '../ui/label'; import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'; import { copyToClipboard } from './utils'; interface ViewKeyPanelProps { keyItem: SSHKey; onExport: () => void; } export const ViewKeyPanel: React.FC = ({ keyItem, onExport, }) => { const { t } = useI18n(); const [copied, setCopied] = useState(false); const handleCopyPublicKey = useCallback(async () => { const ok = await copyToClipboard(keyItem.publicKey || ''); if (!ok) return; setCopied(true); setTimeout(() => setCopied(false), 2000); }, [keyItem.publicKey]); return ( <>

{keyItem.label}

{keyItem.publicKey && (
{keyItem.publicKey}
{copied ? t('cloudSync.githubFlow.copied') : t('action.copyPublicKey')}
)}

{keyItem.type}

{/* Key Export section */}
{t('keychain.export.title')}
); };