import {type ElementType} from 'react'
import {Cloud, Database, ExternalLink, Radio, Route, ShieldCheck} from 'lucide-react'
import {ServiceIcon} from '@/components/serviceIcons'
import {adapterLabel, cloudName, providerDescription, runtimeName} from './cloudConsoleHome.utils'
import type {ProviderBannerProps, RuntimeFlowProps, ServiceGridProps, SummarySectionProps} from './types'
export function ProviderBanner({cloud, runtimeClass, runtimeReachable, onOpenStorage}: ProviderBannerProps) {
return (
Selected Cloud
{cloudName(cloud)}
{providerDescription(cloud)}
)
}
export function SummarySection({
cloud,
runtimeLabel,
runtimeState,
runtimeClass,
runtimeDetail,
activeServices,
activeServicesDetail,
resourceCount,
resourceDetail,
}: SummarySectionProps) {
return (
)
}
export function RuntimeFlow({cloud, status}: RuntimeFlowProps) {
return (
)
}
export function ServiceGrid({services, runtimeReachable, onNavigate, searchQuery}: ServiceGridProps) {
if (services.length === 0) {
return (
{searchQuery ? `No services matching "${searchQuery}"` : 'No services found.'}
)
}
return (
{services.map((service) => {
const isAvailable = service.status === 'available'
const canOpen = isAvailable && service.route && runtimeReachable
const content = (
<>
{service.label}
{isAvailable ? 'available' : 'coming soon'}
{service.count ?? '-'}
{service.meta}
>
)
return canOpen ? (
) : (
{content}
)
})}
)
}
function SummaryTile({label, value, detail, icon, state}: {label: string; value: string; detail: string; icon?: ElementType; state?: string}) {
const Icon = icon
return (
{Icon && }
{label}
{value}
{detail}
)
}
function FlowStep({icon, label, value}: {icon: ElementType; label: string; value: string}) {
const Icon = icon
return (
{label}
{value}
)
}