diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 4b73b75d62e4..06ebc7e3ccb9 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -112,6 +112,42 @@ function WorkspaceCategoriesPage({policyCategories, route}: WorkspaceCategoriesP ); + const getComponentToRender = () => { + if (policyCategories === undefined) { + return ( + + ); + } + + if (categoryList.length === 0) { + return ( + + ); + } + + return ( + + ); + }; + return ( @@ -132,31 +168,7 @@ function WorkspaceCategoriesPage({policyCategories, route}: WorkspaceCategoriesP {translate('workspace.categories.subtitle')} - {policyCategories === undefined ? ( - - ) : categoryList.length ? ( - - ) : ( - - )} + {getComponentToRender()}