aboutsummaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/components/ScrollableList.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/excalidraw/components/ScrollableList.tsx')
-rw-r--r--packages/excalidraw/components/ScrollableList.tsx24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/excalidraw/components/ScrollableList.tsx b/packages/excalidraw/components/ScrollableList.tsx
new file mode 100644
index 0000000..60ca1ad
--- /dev/null
+++ b/packages/excalidraw/components/ScrollableList.tsx
@@ -0,0 +1,24 @@
+import clsx from "clsx";
+import { Children } from "react";
+
+import "./ScrollableList.scss";
+
+interface ScrollableListProps {
+ className?: string;
+ placeholder: string;
+ children: React.ReactNode;
+}
+
+export const ScrollableList = ({
+ className,
+ placeholder,
+ children,
+}: ScrollableListProps) => {
+ const isEmpty = !Children.count(children);
+
+ return (
+ <div className={clsx("ScrollableList__wrapper", className)} role="menu">
+ {isEmpty ? <div className="empty">{placeholder}</div> : children}
+ </div>
+ );
+};