diff --git a/src/ui/components/UploadEquipmentDialog.tsx b/src/ui/components/UploadEquipmentDialog.tsx index f109fdc..75c6be4 100644 --- a/src/ui/components/UploadEquipmentDialog.tsx +++ b/src/ui/components/UploadEquipmentDialog.tsx @@ -1,4 +1,4 @@ -import { Loader2, Upload, X } from 'lucide-react' +import { Loader2, Upload } from 'lucide-react' import { useEffect, useState, useRef } from 'react' import { toast } from 'sonner' import { EQUIPMENT_CATEGORIES, getSubCategories } from '../../lib/categories' @@ -14,13 +14,7 @@ import { } from './ui/dialog' import { Input } from './ui/input' import { Label } from './ui/label' -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from './ui/select' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select' import { Textarea } from './ui/textarea' interface UploadEquipmentDialogProps { @@ -112,10 +106,6 @@ export function UploadEquipmentDialog({ setLoading(true) try { // 1. Upload Asset - const formData = new FormData() - formData.append('file', file) - formData.append('name', name) - const uploadRes = await client.assets.upload.$post({ form: { file: file, @@ -163,46 +153,46 @@ export function UploadEquipmentDialog({ Upload Equipment - - Upload a new equipment image directly. - + Upload a new equipment image directly.
{/* Image Upload Area */}
fileInputRef.current?.click()} + onDragEnter={handleDrag} + onDragLeave={handleDrag} + onDragOver={handleDrag} + onDrop={handleDrop} + onClick={() => fileInputRef.current?.click()} > - {previewUrl ? ( - <> - Preview -
-

Click to change

-
- - ) : ( -
- -

Click or Drag & Drop Image Here

-

or paste from clipboard

-
- )} - + {previewUrl ? ( + <> + Preview +
+

Click to change

+
+ + ) : ( +
+ +

+ Click or Drag & Drop Image Here +

+

or paste from clipboard

+
+ )} +
@@ -216,41 +206,44 @@ export function UploadEquipmentDialog({ />
- - + +
{category && ( -
- - -
+
+ + +
)}