diff --git a/src/app/components/shared/ImageUploader.tsx b/src/app/components/shared/ImageUploader.tsx deleted file mode 100644 index 2c35f4e8..00000000 --- a/src/app/components/shared/ImageUploader.tsx +++ /dev/null @@ -1,87 +0,0 @@ -'use client'; - -import { useState, useRef } from 'react'; -import Image from 'next/image'; - -interface ImageUploaderProps { - onImageSelect: (file: File) => void; - initialImageUrl?: string; -} - -export default function ImageUploader({ onImageSelect, initialImageUrl }: ImageUploaderProps) { - const [previewUrl, setPreviewUrl] = useState(initialImageUrl || null); - const fileInputRef = useRef(null); - - const handleFileChange = (event: React.ChangeEvent) => { - const file = event.target.files?.[0]; - if (file) { - const reader = new FileReader(); - reader.onloadend = () => { - setPreviewUrl(reader.result as string); - }; - reader.readAsDataURL(file); - onImageSelect(file); - } - }; - - const handleClick = () => { - fileInputRef.current?.click(); - }; - - return ( -
-
{ - if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault(); - handleClick(); - } - }} - > - {previewUrl ? ( - Profile preview - ) : ( -
- - - -
- )} -
- - Change Photo - -
-
- -

Click to upload a new profile photo

-
- ); -}