diff --git a/.changeset/every-pianos-hide.md b/.changeset/every-pianos-hide.md new file mode 100644 index 0000000000..cbdb912e37 --- /dev/null +++ b/.changeset/every-pianos-hide.md @@ -0,0 +1,5 @@ +--- +"@ultraviolet/ui": minor +--- + +Add prop `emptyState` on `` that can be usefull when searching diff --git a/packages/ui/src/components/MenuV2/__stories__/Searchable.stories.tsx b/packages/ui/src/components/MenuV2/__stories__/Searchable.stories.tsx index fd1b2b1358..5ca97032c3 100644 --- a/packages/ui/src/components/MenuV2/__stories__/Searchable.stories.tsx +++ b/packages/ui/src/components/MenuV2/__stories__/Searchable.stories.tsx @@ -18,7 +18,7 @@ export const Searchable: StoryFn = () => ( /> } > - + ( - <> - - - - {label} - - {labelDescription || null} - - - {children} - -) +export const Group = ({ + label, + children, + labelDescription, + emptyState, +}: GroupProps) => { + const isChildrenEmpty = Children.count(children) === 0 + + return ( + <> + + + + {label} + + {labelDescription || null} + + + {isChildrenEmpty && emptyState ? emptyState : children} + + ) +}