import { Gauge } from 'lucide-react'; import { stripProtocol } from '@/portainer/filters/filters'; import { useTagsForEnvironment } from '@/portainer/tags/queries'; import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { useEnvironment } from '@/react/portainer/environments/queries'; import { Widget, WidgetTitle, WidgetBody } from '@@/Widget'; export function EnvironmentInfo() { const environmentId = useEnvironmentId(); const { data: environmentData, ...environmentQuery } = useEnvironment(environmentId); const tagsQuery = useTagsForEnvironment(environmentId); const tagNames = tagsQuery.tags?.map((tag) => tag.Name).join(', ') || '-'; return ( {environmentQuery.isError &&
Failed to load environment
} {environmentData && (
Environment {environmentData.Name}
URL {stripProtocol(environmentData.URL) || '-'}
Tags {tagNames}
)}
); }