diff --git a/src/app/admin/custom-requests/[id]/page.tsx b/src/app/admin/custom-requests/[id]/page.tsx index ab18e77..1258e48 100644 --- a/src/app/admin/custom-requests/[id]/page.tsx +++ b/src/app/admin/custom-requests/[id]/page.tsx @@ -3,6 +3,7 @@ import { notFound } from 'next/navigation'; import { prisma } from '@/lib/prisma'; import AdminNav from '@/components/AdminNav'; import ShareButtons from '@/components/ShareButtons'; +import DownloadPhotoButton from '@/components/DownloadPhotoButton'; import { deleteRequest, markRequestDone, markRequestNew } from '../actions'; export default async function CustomRequestDetailPage({ params }: { params: { id: string } }) { @@ -59,6 +60,8 @@ export default async function CustomRequestDetailPage({ params }: { params: { id
+ + { + // Create a link element and trigger download + const link = document.createElement('a'); + link.href = photoUrl; + link.download = `photo-from-${customerName.toLowerCase().replace(/\s+/g, '-')}.png`; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }; + + return ( + + ); +}