From a02677c2b10e2ea5e9ece8d25205c7c33477d7a4 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 5 Oct 2025 20:48:38 +0200 Subject: [PATCH] fix: Empty state for no collections (#10300) --- .../Sidebar/components/Collections.tsx | 22 +++++++++++++++++-- shared/i18n/locales/en_US/translation.json | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/components/Sidebar/components/Collections.tsx b/app/components/Sidebar/components/Collections.tsx index 833e62d940..c12c580da8 100644 --- a/app/components/Sidebar/components/Collections.tsx +++ b/app/components/Sidebar/components/Collections.tsx @@ -18,10 +18,14 @@ import PlaceholderCollections from "./PlaceholderCollections"; import Relative from "./Relative"; import SidebarAction from "./SidebarAction"; import SidebarContext from "./SidebarContext"; +import SidebarLink from "./SidebarLink"; +import Text from "@shared/components/Text"; +import usePolicy from "~/hooks/usePolicy"; function Collections() { - const { documents, collections } = useStores(); + const { documents, auth, collections } = useStores(); const { t } = useTranslation(); + const can = usePolicy(auth.team?.id); const orderedCollections = collections.allActive; const params = useMemo( @@ -57,7 +61,7 @@ function Collections() { options={params} aria-label={t("Collections")} - items={collections.allActive} + items={orderedCollections} loading={} heading={ isDraggingAnyCollection ? ( @@ -68,6 +72,20 @@ function Collections() { /> ) : undefined } + empty={ + // No need for empty state if we're displaying the createCollection action + can.createCollection ? null : ( + + {t("No collections")} + + } + onClick={() => {}} + depth={1.5} + /> + ) + } renderError={(props) => } renderItem={(item, index) => (