import 'server-only'; import { getCloudflareContext } from '@opennextjs/cloudflare'; type ReviewPhotoBucket = { get(key: string): Promise<{ body: ReadableStream } | null>; put(key: string, body: Uint8Array, options: { httpMetadata: { contentType: string } }): Promise; delete(key: string): Promise; }; export function reviewPhotoBucket(): ReviewPhotoBucket { const { REVIEW_PHOTOS } = getCloudflareContext().env as { REVIEW_PHOTOS?: ReviewPhotoBucket }; if (!REVIEW_PHOTOS) throw new Error('Review photo storage binding is missing.'); return REVIEW_PHOTOS; }