diff --git a/src/components/primitives/surface/index.ts b/src/components/primitives/surface/index.ts
index b086f784..183083e1 100644
--- a/src/components/primitives/surface/index.ts
+++ b/src/components/primitives/surface/index.ts
@@ -1,6 +1,6 @@
import clsx from 'clsx/lite';
-export const menuSurfaceStyles = (className?: string) => clsx(
+export const MENU_SURFACE_STYLES = clsx(
'z-10',
'min-w-[8rem]',
'component-surface',
@@ -12,5 +12,4 @@ export const menuSurfaceStyles = (className?: string) => clsx(
'data-[side=top]:animate-fade-in-from-bottom',
'data-[side=bottom]:animate-fade-in-from-top',
'data-[side=right]:animate-fade-in-from-top',
- className,
);
diff --git a/src/photo/form/FieldsetPhotoChooser.tsx b/src/photo/form/FieldsetPhotoChooser.tsx
index 02fc4cca..c4154924 100644
--- a/src/photo/form/FieldsetPhotoChooser.tsx
+++ b/src/photo/form/FieldsetPhotoChooser.tsx
@@ -9,17 +9,16 @@ import {
import clsx from 'clsx/lite';
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
import ImageMedium from '@/components/image/ImageMedium';
-import { menuSurfaceStyles } from '@/components/primitives/surface';
+import { MENU_SURFACE_STYLES } from '@/components/primitives/surface';
import { IoSearch } from 'react-icons/io5';
import { useCallback, useEffect, useRef, useState } from 'react';
import usePhotoQuery from '../usePhotoQuery';
-import { BiChevronDown } from 'react-icons/bi';
+import { BiChevronRight } from 'react-icons/bi';
import SegmentMenu from '@/components/SegmentMenu';
import IconFavs from '@/components/icons/IconFavs';
import InfinitePhotoScroll from '../InfinitePhotoScroll';
-
-// TODO:
-// Create empty state for all modes, including no search results
+import AdminEmptyState from '@/admin/AdminEmptyState';
+import { TbPhotoSearch } from 'react-icons/tb';
type Mode = 'all' | 'favs' | 'search';
@@ -66,6 +65,7 @@ export default function FieldsetPhotoChooser({
photos: photosQuery,
isLoading: isLoadingPhotoQuery,
reset: resetPhotoQuery,
+ resultsNotFound,
} = usePhotoQuery({ query, isPrivate: true });
const reset = useCallback((resetMenu?: boolean) => {
@@ -125,11 +125,18 @@ export default function FieldsetPhotoChooser({
'font-sans',
'text-xs text-medium font-medium uppercase tracking-wider',
'py-1',
+ 'select-none',
)}>
{label}
-
+
e.preventDefault()}
align="start"
- sideOffset={10}
- className={menuSurfaceStyles('z-20 rounded-2xl pb-0 overflow-auto')}
+ sideOffset={-80}
+ className={clsx(
+ MENU_SURFACE_STYLES,
+ 'z-20 rounded-2xl pb-0 overflow-auto',
+ )}
>
-
- setQuery(e.target.value)}
- />
-
-
-
+
+
+ setQuery(e.target.value)}
+ />
+
+
+ {showQuery && resultsNotFound &&
+
}
+ className="translate-y-8"
+ includeContainer={false}
+ >
+ No photos found
+ }
+ {!showQuery && photosToShow.length === 0 &&
+
}
+ className="translate-y-16"
+ includeContainer={false}
+ >
+ No photos
+ }
{photosToShow.map(photo => renderPhotoButton(photo))}
diff --git a/src/photo/usePhotoQuery.ts b/src/photo/usePhotoQuery.ts
index eeb425bd..52091c16 100644
--- a/src/photo/usePhotoQuery.ts
+++ b/src/photo/usePhotoQuery.ts
@@ -28,6 +28,11 @@ export default function usePhotoQuery({
const [photos, setPhotos] = useState
([]);
+ const resultsNotFound =
+ queryDebounced.length >= minimumQueryLength &&
+ !isLoading &&
+ photos.length === 0;
+
const reset = useCallback(() => {
setPhotos([]);
setIsLoading(false);
@@ -62,6 +67,7 @@ export default function usePhotoQuery({
queryFormatted,
photos,
isLoading,
+ resultsNotFound,
reset,
};
}