import { useTranslation } from 'react-i18next'; import { Input } from '@/components/ui/input'; import type { Credential } from '@/components/deploy/credential-manager/types'; interface ImportCredentialSettingsProps { defaultSshPort: string; onDefaultSshPortChange: (value: string) => void; sshCredentials: Credential[]; rdpCredentials: Credential[]; selectedSshCredentialId: string; selectedRdpCredentialId: string; onSelectedSshCredentialIdChange: (value: string) => void; onSelectedRdpCredentialIdChange: (value: string) => void; compact?: boolean; } function credentialLabel(cred: Credential) { return `${cred.name}${cred.summary ? ` ยท ${cred.summary}` : ''}`; } export function ImportCredentialSettings({ defaultSshPort, onDefaultSshPortChange, sshCredentials, rdpCredentials, selectedSshCredentialId, selectedRdpCredentialId, onSelectedSshCredentialIdChange, onSelectedRdpCredentialIdChange, compact = false, }: ImportCredentialSettingsProps) { const { t } = useTranslation(); const labelClass = compact ? 'block text-xs font-medium text-[var(--dg-text-secondary)] mb-1' : 'block text-sm font-medium text-[var(--dg-text-secondary)] mb-2'; const panelClass = compact ? 'grid grid-cols-1 sm:grid-cols-3 gap-4 p-4 rounded-lg bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]' : 'grid grid-cols-1 md:grid-cols-3 gap-4'; const inputBg = compact ? 'bg-[var(--dg-bg-tertiary)]' : 'bg-[var(--dg-bg-secondary)]'; return (
{t('server.importCred.noSshCred')}
) : ( )}{t('server.importCred.noRdpCred')}
) : ( )}