Oops probably should've committed, not even sure what's changed. Set up MDX, set up cv and print, set up dark mode, look at react query
This commit is contained in:
32
src/app/(root)/photos/page.tsx
Normal file
32
src/app/(root)/photos/page.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import Image from "next/image";
|
||||
import Lightbox from "@/components/lightbox";
|
||||
import { type GetPhotos } from "@/app/api/photos/route";
|
||||
|
||||
async function getImageData(): Promise<GetPhotos> {
|
||||
const res = await fetch(`http://localhost:3000/api/photos`, { next: { revalidate: false, tags: ['photos'] } });
|
||||
console.log(res);
|
||||
return res.json() as Promise<GetPhotos>;
|
||||
}
|
||||
|
||||
export default async function Photos(): Promise<React.JSX.Element> {
|
||||
const {data: imageData} = await getImageData();
|
||||
|
||||
return (
|
||||
<Lightbox imageData={imageData.images}>
|
||||
{imageData.images.map((image) => (
|
||||
<Image
|
||||
key={image.src}
|
||||
alt={image.src}
|
||||
src={image.src}
|
||||
className="object-contain h-60 w-80"
|
||||
sizes="100vw"
|
||||
loading="lazy"
|
||||
width={image.width}
|
||||
height={image.height}
|
||||
blurDataURL={image.blur}
|
||||
placeholder="blur"
|
||||
/>
|
||||
))}
|
||||
</Lightbox>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user