// app/gallery/page.tsx import fs from 'fs'; import path from 'path'; import sharp from 'sharp'; import PhotoGallery from '@/app/components/PhotoGallery'; async function getImages() { const galleryDir = path.join(process.cwd(), 'public/gallery'); const files = fs.readdirSync(galleryDir); const imagePromises = files .filter((file) => file.match(/\.(jpg|jpeg|png)$/i)) .map(async (file) => { const filePath = path.join(galleryDir, file); const metadata = await sharp(filePath).metadata(); return { src: `/gallery/${file}`, width: metadata.width || 1000, height: metadata.height || 1000, name: file, }; }); return Promise.all(imagePromises); } export default async function GalleryPage() { const images = await getImages(); return (
{/* 1. Background Ambient Glow */}
{/* 2. Modernized Header */}

Gallery

Photography Collection

A curated collection of photograps. Finding the best subjects to capture, from natural landscapes to the night sky.

{/* 3. The Gallery Grid */}
); }