* Refactor photo/menu form components * Fix pre-rendering error * Incorporate server-side photo chooser data * Create custom photo chooser grid * Extract photo query logic to hook * Make photo chooser searchable * Create custom photo chooser menu * Animate query menu, add favs to chooser * Add photo chooser empty states
21 lines
674 B
TypeScript
21 lines
674 B
TypeScript
import AdminComponentPageClient from '@/admin/AdminComponentPageClient';
|
|
import { INFINITE_SCROLL_GRID_INITIAL } from '@/photo';
|
|
import { getPhotosCached, getPhotosMetaCached } from '@/photo/cache';
|
|
import { TAG_FAVS } from '@/tag';
|
|
|
|
export default async function ComponentsPage() {
|
|
const photos = await getPhotosCached({ limit: INFINITE_SCROLL_GRID_INITIAL });
|
|
const photosCount = await getPhotosMetaCached()
|
|
.then(({ count }) => count);
|
|
const photosFavs = await getPhotosCached({ tag: TAG_FAVS });
|
|
|
|
return (
|
|
<AdminComponentPageClient
|
|
photo={photos[0]}
|
|
photos={photos}
|
|
photosCount={photosCount}
|
|
photosFavs={photosFavs}
|
|
/>
|
|
);
|
|
}
|