From 5f1209f1dbaec55e36f5d3320e65b4c3cfc6168a Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:13:26 +0530 Subject: [PATCH] chore: empty state for multi-level dropdown (#1802) * fix :label filter should show something if there is no label #1779 (#1795) * style: children empty state --------- Co-authored-by: Pankaj Chotaliya <34762752+pankajvc@users.noreply.github.com> --- .../components/ui/multi-level-dropdown.tsx | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/apps/app/components/ui/multi-level-dropdown.tsx b/apps/app/components/ui/multi-level-dropdown.tsx index 9a4ebdbe4..cfdaa72d5 100644 --- a/apps/app/components/ui/multi-level-dropdown.tsx +++ b/apps/app/components/ui/multi-level-dropdown.tsx @@ -66,7 +66,7 @@ export const MultiLevelDropdown: React.FC = ({ > {options.map((option) => (
@@ -107,7 +107,7 @@ export const MultiLevelDropdown: React.FC = ({ {option.hasChildren && option.id === openChildFor && (
= ({ > {option.children ? (
- {option.children.map((child) => { - if (child.element) return child.element; - else - return ( - - ); - })} + {option.children.length === 0 ? ( +

+ No {option.label} found +

//if no children found, show this message. + ) : ( + option.children.map((child) => { + if (child.element) return child.element; + else + return ( + + ); + }) + )}
) : (