From 208efe2808b43afc412fe24ead0ebc93cb790ab7 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 28 Feb 2024 16:28:00 -0700 Subject: [PATCH] fix lint --- .../categories/WorkspaceCategoriesPage.tsx | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) 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()}