mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 13:31:12 -05:00
Refactor: Implement Cloudflare Image Variants
This commit is contained in:
@@ -5,6 +5,7 @@ import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Image as ImageIcon, ImagePlus, X } from 'lucide-react';
|
||||
import { UppyPhotoUpload } from './UppyPhotoUpload';
|
||||
import { getCloudflareImageUrl } from '@/lib/cloudflareImageUtils';
|
||||
|
||||
export type ImageType = 'logo' | 'banner' | 'card';
|
||||
|
||||
@@ -140,7 +141,15 @@ export function EntityImageUploader({
|
||||
{hasImage ? (
|
||||
<div className="relative aspect-[16/9] bg-muted">
|
||||
<img
|
||||
src={currentImage.url}
|
||||
src={
|
||||
currentImage.url || (
|
||||
type === 'logo'
|
||||
? getCloudflareImageUrl(currentImage.id, 'logo')
|
||||
: type === 'banner'
|
||||
? getCloudflareImageUrl(currentImage.id, 'banner')
|
||||
: getCloudflareImageUrl(currentImage.id, 'card')
|
||||
)
|
||||
}
|
||||
alt={`${spec.label} preview`}
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user