Skip to content

Commit c16cc71

Browse files
committed
Merge branch 'main' into feat/component-cards
2 parents f4831d8 + a2f9e17 commit c16cc71

File tree

1 file changed

+48
-38
lines changed

1 file changed

+48
-38
lines changed

src/spaces/mcp/pages/McpPage.tsx

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export default function McpPage() {
8181
return <IllustratedError details={error?.message} />;
8282
}
8383

84+
const isComponentInstalledCrossplane = !!mcp.spec?.components.crossplane;
85+
const isComponentInstalledFlux = !!mcp.spec?.components.flux;
86+
const isComponentInstalledLandscaper = !!mcp.spec?.components.landscaper;
87+
8488
return (
8589
<McpContextProvider
8690
context={{
@@ -153,46 +157,52 @@ export default function McpPage() {
153157
</ObjectPageSubSection>
154158
</ObjectPageSection>
155159

156-
<ObjectPageSection id="crossplane" titleText={t('McpPage.crossplaneTitle')}>
157-
<ObjectPageSubSection id="providers" titleText={t('McpPage.providersTitle')} className={styles.section}>
158-
<Providers />
159-
</ObjectPageSubSection>
160-
<ObjectPageSubSection
161-
id="provider-configs"
162-
titleText={t('McpPage.providerConfigsTitle')}
163-
className={styles.section}
164-
>
165-
<ProvidersConfig />
166-
</ObjectPageSubSection>
167-
<ObjectPageSubSection
168-
id="managed-resources"
169-
titleText={t('McpPage.managedResourcesTitle')}
170-
className={styles.section}
171-
>
172-
<ManagedResources />
173-
</ObjectPageSubSection>
174-
</ObjectPageSection>
160+
{isComponentInstalledCrossplane && (
161+
<ObjectPageSection id="crossplane" titleText={t('McpPage.crossplaneTitle')}>
162+
<ObjectPageSubSection id="providers" titleText={t('McpPage.providersTitle')} className={styles.section}>
163+
<Providers />
164+
</ObjectPageSubSection>
165+
<ObjectPageSubSection
166+
id="provider-configs"
167+
titleText={t('McpPage.providerConfigsTitle')}
168+
className={styles.section}
169+
>
170+
<ProvidersConfig />
171+
</ObjectPageSubSection>
172+
<ObjectPageSubSection
173+
id="managed-resources"
174+
titleText={t('McpPage.managedResourcesTitle')}
175+
className={styles.section}
176+
>
177+
<ManagedResources />
178+
</ObjectPageSubSection>
179+
</ObjectPageSection>
180+
)}
175181

176-
<ObjectPageSection id="flux" titleText={t('McpPage.fluxTitle')}>
177-
<ObjectPageSubSection
178-
id="git-repositories"
179-
titleText={t('McpPage.gitRepositoriesTitle')}
180-
className={styles.section}
181-
>
182-
<GitRepositories />
183-
</ObjectPageSubSection>
184-
<ObjectPageSubSection
185-
id="kustomizations"
186-
titleText={t('McpPage.kustomizationsTitle')}
187-
className={styles.section}
188-
>
189-
<Kustomizations />
190-
</ObjectPageSubSection>
191-
</ObjectPageSection>
182+
{isComponentInstalledFlux && (
183+
<ObjectPageSection id="flux" titleText={t('McpPage.fluxTitle')}>
184+
<ObjectPageSubSection
185+
id="git-repositories"
186+
titleText={t('McpPage.gitRepositoriesTitle')}
187+
className={styles.section}
188+
>
189+
<GitRepositories />
190+
</ObjectPageSubSection>
191+
<ObjectPageSubSection
192+
id="kustomizations"
193+
titleText={t('McpPage.kustomizationsTitle')}
194+
className={styles.section}
195+
>
196+
<Kustomizations />
197+
</ObjectPageSubSection>
198+
</ObjectPageSection>
199+
)}
192200

193-
<ObjectPageSection id="landscapers" titleText={t('McpPage.landscapersTitle')} className={styles.section}>
194-
<Landscapers />
195-
</ObjectPageSection>
201+
{isComponentInstalledLandscaper && (
202+
<ObjectPageSection id="landscapers" titleText={t('McpPage.landscapersTitle')} className={styles.section}>
203+
<Landscapers />
204+
</ObjectPageSection>
205+
)}
196206
</ObjectPage>
197207
</WithinManagedControlPlane>
198208
</AuthProviderMcp>

0 commit comments

Comments
 (0)