import React from 'react' import { cn } from '../lib/utils' import { Plus, X } from 'lucide-react' interface ImageUploaderProps { images: { uri?: string }[] onAddImage: () => void onRemoveImage: (uri: string) => void existingImageUrls?: string[] onRemoveExistingImage?: (url: string) => void allowMultiple?: boolean } export function ImageUploader({ images, existingImageUrls = [], onAddImage, onRemoveImage, onRemoveExistingImage, allowMultiple = true, }: ImageUploaderProps) { const totalCount = images.length + existingImageUrls.length return (
{existingImageUrls.map((url, index) => (
{`Existing
))} {images.map((image, index) => (
{`Upload
))} {(!allowMultiple || totalCount < 1) && ( )}
) }