/** * Registry Configuration List * Display all registry configurations */ import React from "react"; import { Edit2, Trash2, Database, ExternalLink } from "lucide-react"; import type { AppRegistry } from "@/core/types"; import { EmptyStateSimple } from "@/shared/components"; import { LoadingText, EmptyText } from "@/shared/constants"; import type { User } from "@/app/providers/AuthContext"; import { canUseResourceAction, getVisibilityLabel, type ResourceWithAccess } from "@/app/providers/auth-model"; interface RegistryListProps { registries: AppRegistry[]; loading: boolean; onEdit: (registry: AppRegistry) => void; onDelete: (registry: AppRegistry) => void; user?: User | null; } export const RegistryList: React.FC = ({ registries, loading, onEdit, onDelete, user, }) => { if (loading) { return (
{LoadingText.LOADING_REGISTRIES}
); } if (registries.length === 0) { return ( ); } return (
{registries.map((registry) => { const access = registry as AppRegistry & ResourceWithAccess; const canEdit = canUseResourceAction(access, "update", user); const canDelete = canUseResourceAction(access, "delete", user); return (
{/* Left: Basic Info */}

{registry.name}

{getVisibilityLabel(access.visibility)} {registry.insecure && ( Insecure )}
{registry.description && (

{registry.description}

)} {registry.username && (

Username: {registry.username}

)}
{/* Right: Action Buttons */}
); })}
); };