Skip to content

Commit

Permalink
recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ogeobubu committed Oct 22, 2024
1 parent 2f4db60 commit a4dfbea
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client/src/pages/upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ const ImageUpload: React.FC = () => {
const [modalVisible, setModalVisible] = useState(false);
const [classificationResult, setClassificationResult] = useState<LeafResponse | null>(null);

const { mutate, isLoading, isError, isSuccess } = useMutation({
const { mutate } = useMutation({
mutationFn: uploadImage,
onSuccess: (data) => {
console.log("Upload success:", data);
setClassificationResult(data);
setModalVisible(true);
},
Expand Down Expand Up @@ -99,20 +98,20 @@ const ImageUpload: React.FC = () => {
</div>
<Button
onClick={handleUpload}
disabled={!selectedFile || isLoading}
// disabled={!selectedFile || isLoading}
className="mt-4"
>
Upload Image
</Button>
{isLoading && (
{/* {isLoading && (
<p className="mt-2 text-blue-500">Uploading...</p>
)}
{isError && (
<p className="mt-2 text-red-500">Error uploading image.</p>
)}
{isSuccess && (
<p className="mt-2 text-green-500">Upload successful!</p>
)}
)} */}
<p className="mt-6 text-white text-center">
File must be JPEG, JPG or PNG and up to 40MB
</p>
Expand Down

0 comments on commit a4dfbea

Please sign in to comment.