Initial GeoIntel V1 foundation
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import type { ProviderCapability } from '../../types'
|
||||
|
||||
interface ProviderPanelProps {
|
||||
providers: ProviderCapability[]
|
||||
loadingCapabilities: boolean
|
||||
capabilitiesError: string | null
|
||||
onRefresh: () => void
|
||||
}
|
||||
|
||||
export function ProviderPanel({
|
||||
providers,
|
||||
loadingCapabilities,
|
||||
capabilitiesError,
|
||||
onRefresh,
|
||||
}: ProviderPanelProps): JSX.Element {
|
||||
return (
|
||||
<section>
|
||||
<h2>Provider Capabilities</h2>
|
||||
<button type="button" onClick={onRefresh} disabled={loadingCapabilities}>
|
||||
Refresh providers
|
||||
</button>
|
||||
{loadingCapabilities ? <p>Loading provider capabilities...</p> : null}
|
||||
{capabilitiesError ? <p className="error">{capabilitiesError}</p> : null}
|
||||
{providers.length === 0 && !loadingCapabilities ? <p>No providers reported by backend</p> : null}
|
||||
<ul>
|
||||
{providers.map((provider) => (
|
||||
<li key={provider.provider_name}>
|
||||
<strong>{provider.display_name}</strong>
|
||||
<div>provider: {provider.provider_name}</div>
|
||||
<div>authority: {provider.authority_level}</div>
|
||||
<div>status: {provider.status}</div>
|
||||
<div>configured: {provider.configured ? 'yes' : 'no'}</div>
|
||||
<div>layers: {provider.supported_layers.join(', ')}</div>
|
||||
<div>geometry: {provider.supported_geometry_types.join(', ')}</div>
|
||||
<div>query modes: {provider.supported_query_modes.join(', ')}</div>
|
||||
<div>limitation: {provider.limitation_message}</div>
|
||||
<div>attribution: {provider.attribution}</div>
|
||||
<div>license: {provider.license_note}</div>
|
||||
{!provider.configured && provider.not_configured_reason ? (
|
||||
<div>reason: {provider.not_configured_reason}</div>
|
||||
) : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user