diff --git a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx index d4244419cb..f76690c010 100644 --- a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx +++ b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx @@ -152,6 +152,7 @@ export interface EntityLayoutProps { UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[]; UNSTABLE_contextMenuOptions?: contextMenuOptions; children?: React.ReactNode; + NotFoundComponent?: React.ReactNode; } /** @@ -176,6 +177,7 @@ export const EntityLayout = (props: EntityLayoutProps) => { UNSTABLE_extraContextMenuItems, UNSTABLE_contextMenuOptions, children, + NotFoundComponent, } = props; const { kind, namespace, name } = useRouteRefParams(entityRouteRef); const { entity, loading, error } = useAsyncEntity(); @@ -259,7 +261,17 @@ export const EntityLayout = (props: EntityLayoutProps) => { {error && ( - {error.toString()} + {NotFoundComponent ? ( + NotFoundComponent + ) : ( + + There is no {kind} with the requested{' '} + + kind, namespace, and name + + . + + )} )}