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:
2024-08-08 01:21:34 +01:00
parent 433ba19a7a
commit 7f88af8ee3
30 changed files with 3184 additions and 703 deletions

View 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>
);
}