import { Cloud, Laptop, ShieldCheck, X } from 'lucide-react'; import { projectDomainConnectionSteps, projectDomainTrustSource, type DomainAccessProjection } from '../domain-connection'; import { canEnterSelectedDomainRuntime, projectDomainRuntimeBoundary, type DomainEntryTarget, type DomainNodeType } from '../domain-entry-state'; import { publicDomainDirectory, type DomainRouteId } from '../public-domain-directory'; interface Props { access: DomainAccessProjection; target: DomainEntryTarget | null; open: boolean; onClose: () => void; onSelectTarget: (routeId: DomainRouteId) => void; onSelectNodeType: (nodeType: DomainNodeType) => void; onEnterRuntime: () => void; onOpenCodeChannel: () => void; } export function DomainConnectionSheet({ access, target, open, onClose, onSelectTarget, onSelectNodeType, onEnterRuntime, onOpenCodeChannel }: Props) { if (!open) return null; const steps = projectDomainConnectionSteps(access); const canEnter = canEnterSelectedDomainRuntime(target, access); return (
{ if (event.target === event.currentTarget) onClose(); }}>
{target?.domain.stableDomainId ?? 'SELECT-DOMAIN'}

{target ? `接入${target.domain.displayName}` : '选择要接入的域'}

进入域不是切换页面。系统必须验证账户、登记节点、目标域授权、会话能力和在线回执。

{publicDomainDirectory.map(domain => )}
{!target ?

{projectDomainRuntimeBoundary(target, access)}

: <>

{projectDomainTrustSource(access)}

    {steps.map((step, index) => (
  1. {step.state === 'verified' ?
    {step.label}{step.detail}
    {step.state === 'verified' ? '已验证' : step.state === 'checking' ? '核对中' : '待完成'}
  2. ))}

{projectDomainRuntimeBoundary(target, access)} 代码频道账号只用于仓库与同步,不能单独签发域权限。

}
); }