diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 13b6fb01..94ea5943 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,12 +1,12 @@ import React from 'react'; -import { BrowserRouter as Router } from 'react-router-dom'; +import { BrowserRouter } from 'react-router-dom'; import MainContent from './MainContent'; function App() { return ( - + - + ); } diff --git a/frontend/src/MainContent.jsx b/frontend/src/MainContent.jsx index 43c4b6a1..d96ff56b 100644 --- a/frontend/src/MainContent.jsx +++ b/frontend/src/MainContent.jsx @@ -38,7 +38,7 @@ const MainContent = () => { } /> } /> } /> - } /> + } /> } /> } /> } /> diff --git a/frontend/src/components/AIEngine.jsx b/frontend/src/components/AIEngine.jsx index 4e49cb2b..4c0feecd 100644 --- a/frontend/src/components/AIEngine.jsx +++ b/frontend/src/components/AIEngine.jsx @@ -1,13 +1,86 @@ import React, { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router-dom'; const AIEngine = () => { + const {id} = useParams(); // Extracts the ID from the URL + const index = parseInt(id) - 1; + console.log(index) const [selectedFile, setSelectedFile] = useState(null); const [fileName, setFileName] = useState('No file chosen'); const [previewUrl, setPreviewUrl] = useState(null); // To store the image preview URL const [isLoading, setIsLoading] = useState(false); const navigate = useNavigate(); - + console.log(id) + const cropDetail = + [ + { + "id": 1, + "name": "Sugarcane", + "questions": { + "Necessity": "• Early detection prevents sugarcane mosaic virus and smut disease.
• Improves the overall yield of sugar and fiber.
• Reduces economic losses by preventing cane rot.
• Helps manage pests like borers and aphids.
• Enables targeted treatment for red rot.
• Supports sustainable practices for soil health.
• Protects biodiversity in sugarcane-growing ecosystems.", + "Prevention": "• Inspect plants regularly for symptoms of red rot and smut.
• Practice rotation with non-host crops like legumes to reduce disease buildup.
• Maintain sanitation of tools and harvesting equipment to prevent disease spread.
• Use disease-resistant varieties like Co-0238.
• Ensure proper drainage to avoid waterlogging that can lead to root rot.
• Apply fertilizers like nitrogen and potassium at the right intervals to promote healthy growth.
• Implement integrated pest management strategies to control pests like top shoot borers." + } + }, + { + "id": 2, + "name": "Apple", + "questions": { + "Necessity": "• Early detection helps prevent apple scab and fire blight.
• Improves the overall quality and size of apples.
• Reduces economic losses caused by storage diseases.
• Helps manage pests like codling moths and aphids.
• Enables targeted treatment for powdery mildew and rust.
• Supports organic and sustainable apple farming.
• Protects pollinator species essential for apple orchards.", + "Prevention": "• Regularly inspect trees for signs of apple scab, fire blight, and fruit rot.
• Implement crop rotation with non-fruit-bearing plants to reduce disease buildup.
• Prune and sanitize tools to prevent the spread of diseases like fire blight.
• Select disease-resistant varieties such as Liberty or Enterprise.
• Ensure optimal irrigation without waterlogging to prevent root rot.
• Apply fertilizers like phosphorus and potassium for balanced tree nutrition.
• Implement pest management strategies to control codling moth infestations." + } + }, + { + "id": 3, + "name": "Blueberry", + "questions": { + "Necessity": "• Early detection helps prevent mummy berry and botrytis blight.
• Improves the overall yield and sweetness of blueberries.
• Reduces economic losses from fungal infections and bird damage.
• Helps manage pests like spotted wing drosophila.
• Enables targeted control for powdery mildew and anthracnose.
• Supports organic and low-impact farming methods.
• Preserves beneficial insects in blueberry ecosystems.", + "Prevention": "• Regularly inspect plants for signs of mummy berry and anthracnose.
• Practice crop rotation and avoid planting blueberries in areas with high disease pressure.
• Sanitize pruning shears and tools to avoid spreading diseases like botrytis blight.
• Choose disease-resistant varieties like 'Duke' or 'Bluecrop'.
• Ensure proper irrigation without water stagnation to avoid root diseases.
• Use organic fertilizers and apply mulch to maintain soil moisture.
• Implement integrated pest management for controlling pests like blueberry maggots." + } + }, + { + "id": 4, + "name": "Cherry", + "questions": { + "Necessity": "• Early detection helps prevent brown rot and bacterial canker.
• Improves the overall quality of cherries and prevents fruit cracking.
• Reduces economic losses caused by post-harvest diseases.
• Helps manage pests like cherry fruit flies and aphids.
• Enables targeted treatment for powdery mildew and leaf spot.
• Supports organic cherry production and sustainable practices.
• Maintains the biodiversity needed for pollination in orchards.", + "Prevention": "• Regularly inspect trees for signs of brown rot, bacterial canker, and powdery mildew.
• Rotate crops with non-fruit-bearing plants to reduce disease buildup.
• Sanitize tools to prevent the spread of fungal infections.
• Plant disease-resistant varieties like 'Lapins' or 'Stella'.
• Ensure proper irrigation and avoid over-watering, which can lead to root rot.
• Apply balanced fertilizers to support strong fruit and tree development.
• Implement pest control strategies for managing aphids and fruit flies." + } + }, + { + "id": 5, + "name": "Corn", + "questions": { + "Necessity": "• Early detection prevents smut, rust, and stalk rot.
• Improves the overall yield and quality of corn kernels.
• Reduces economic losses from pests like armyworms.
• Helps manage pests like corn earworms and rootworm beetles.
• Enables targeted treatment for diseases like northern corn leaf blight.
• Supports sustainable corn farming and biodiversity in fields.
• Protects soil health through reduced pesticide use.", + "Prevention": "• Regularly inspect fields for signs of smut, rust, and stalk rot.
• Practice crop rotation with legumes or grasses to reduce disease pressure.
• Sanitize tools and machinery to prevent the spread of diseases.
• Choose disease-resistant hybrids like 'Pioneer P1184'.
• Ensure proper irrigation and drainage to avoid waterlogged soils.
• Apply fertilizers like nitrogen at optimal growth stages for strong plant development.
• Implement integrated pest management for controlling armyworms and earworms." + } + }, + { + "id": 6, + "name": "Grape", + "questions": { + "Necessity": "• Early detection helps prevent downy mildew and powdery mildew.
• Improves the overall yield and quality of grape clusters.
• Reduces economic losses caused by fungal diseases and pests.
• Helps manage pests like grape berry moth and mealybugs.
• Enables targeted treatment for black rot and leaf spot.
• Supports sustainable vineyard management practices.
• Protects beneficial organisms in the vineyard ecosystem.", + "Prevention": "• Regularly inspect grapevines for signs of mildew and black rot.
• Practice crop rotation and avoid replanting in disease-prone areas.
• Sanitize tools to prevent the spread of fungal infections.
• Choose disease-resistant varieties like 'Chardonnay' or 'Cabernet Sauvignon'.
• Ensure proper watering and drainage to avoid excessive moisture that leads to fungal growth.
• Apply organic fertilizers to support healthy vine growth.
• Implement integrated pest management to control grape berry moth and other pests." + } + }, + { + "id": 7, + "name": "Orange", + "questions": { + "Necessity": "• Early detection prevents citrus greening and black spot.
• Improves the overall quality and sweetness of oranges.
• Reduces economic losses caused by fungal diseases and pests.
• Helps manage pests like citrus leaf miners and aphids.
• Enables targeted treatment for root rot and sooty mold.
• Supports organic citrus farming and sustainable practices.
• Preserves biodiversity in orange groves, supporting pollinator species.", + "Prevention": "• Regularly inspect trees for signs of citrus greening and root rot.
• Practice crop rotation with non-citrus crops to reduce disease buildup.
• Sanitize pruning tools to avoid spreading infections.
• Plant disease-resistant varieties like 'Washington Navel'.
• Ensure proper watering and drainage to avoid root diseases.
• Apply organic or balanced fertilizers to maintain healthy fruit production.
• Implement pest management to control leaf miners and aphids." + } + }, + { + "id": 8, + "name": "Peach", + "questions": { + "Necessity": "• Early detection helps prevent peach leaf curl and brown rot.
• Improves the overall quality and yield of peaches.• Reduces economic losses from post-harvest diseases.
• Helps manage pests like peach tree borers and aphids.
• Enables targeted treatment for shot hole disease and powdery mildew.
• Supports sustainable farming methods for peach orchards.
• Protects beneficial insects and biodiversity in the ecosystem.", + "Prevention": "• Regularly inspect trees for signs of leaf curl, brown rot, and shot hole disease." + } + } + + + ]; + const handleFileChange = (event) => { const file = event.target.files[0]; setSelectedFile(file); @@ -22,6 +95,7 @@ const AIEngine = () => { } }; + const handleSubmit = async (event) => { event.preventDefault(); if (!selectedFile) { @@ -32,16 +106,24 @@ const AIEngine = () => { setIsLoading(true); const formData = new FormData(); formData.append('image', selectedFile); - + let backendAPI = "" + if (id == 1){ + backendAPI = "http://127.0.0.1:5000/submit_sugarcane" + console.log("1 here") + } + else{ + backendAPI = "https://disease-prediction-api-2.onrender.com/submit" + } try { - const response = await fetch('https://disease-prediction-api-2.onrender.com/submit', { + const response = await fetch(backendAPI, { method: 'POST', body: formData, }); if (response.ok) { const result = await response.json(); - navigate('/submit', { state: { result } }); + console.log(result) + navigate('/submit', { state: { result,id } }); } else { throw new Error('File upload failed'); } @@ -56,19 +138,25 @@ const AIEngine = () => { return (
-

🍀AI Engine🍀

-

Let AI Engine Help You To Detect Disease

+

🍀{cropDetail[index].name} Disease Prediction Engine🍀

Why is it necessary to detect disease in plants?
-

- Plant diseases affect the growth of their respective species... +

+

+ + {!previewUrl && (Upload Crop)} +
{/* Image preview */} {previewUrl && ( @@ -100,6 +188,7 @@ const AIEngine = () => {

Simply upload your plant's leaf image and then see the magic of AI. +

@@ -115,150 +204,9 @@ const AIEngine = () => {
-
Prevent Plant Disease by following these steps:
-
    -
  1. Follow Good Sanitation Practices.
  2. -
  3. Fertilize to Keep Your Plants Healthy.
  4. -
  5. Inspect Plants for Diseases Before You Bring Them Home.
  6. -
  7. Allow the Soil to Warm Before Planting.
  8. -
  9. Ensure a Healthy Vegetable Garden By Rotating Crops.
  10. -
  11. Provide Good Air Circulation.
  12. -
  13. Remove Diseased Stems and Foliage.
  14. -
- - More info - -
-
-
- ); -}; - -export default AIEngine; - - -{/*} -import React, { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; - -const AIEngine = () => { - const [selectedFile, setSelectedFile] = useState(null); - const [fileName, setFileName] = useState('No file chosen'); - const [isLoading, setIsLoading] = useState(false); - const navigate = useNavigate(); - - const handleFileChange = (event) => { - const file = event.target.files[0]; - setSelectedFile(file); - setFileName(file ? file.name : 'No file chosen'); - }; - - const handleSubmit = async (event) => { - event.preventDefault(); - if (!selectedFile) { - alert('Please select a file'); - return; - } - - setIsLoading(true); - const formData = new FormData(); - formData.append('image', selectedFile); - - try { - // const response = await fetch('http://127.0.0.1:5000/submit', { - const response = await fetch('https://disease-prediction-api-2.onrender.com/submit', { - method: 'POST', - body: formData, - }); - - if (response.ok) { - const result = await response.json(); - navigate('/submit', { state: { result } }); - } else { - throw new Error('File upload failed'); - } - } catch (error) { - console.error('Error:', error); - alert('An error occurred while uploading the file'); - } finally { - setIsLoading(false); - } - }; - - return ( -
-
-

🍀AI Engine🍀

-

Let AI Engine Help You To Detect Disease

-
- -
-
-
Why is it necessary to detect disease in plants?
-

- Plant diseases affect the growth of their respective species. In addition, some research gaps are - identified from which to obtain greater transparency for detecting diseases in plants, even - before their symptoms appear clearly. Diagnosis is one of the most important aspects of a plant pathologist's training. Without proper - identification of the disease and the disease-causing agent, disease control measures can be a - waste of time and money and can lead to further plant losses. Proper disease diagnosis is - necessary. -

-
- -
- Plant - - -
- - - {fileName} -
- -

- Simply upload your plant's leaf image and then see the magic of AI. -

- -
- -
- -
- -
-
Prevent Plant Disease by following these steps:
-
    -
  1. Follow Good Sanitation Practices.
  2. -
  3. Fertilize to Keep Your Plants Healthy.
  4. -
  5. Inspect Plants for Diseases Before You Bring Them Home.
  6. -
  7. Allow the Soil to Warm Before Planting.
  8. -
  9. Ensure a Healthy Vegetable Garden By Rotating Crops.
  10. -
  11. Provide Good Air Circulation
  12. -
  13. Remove Diseased Stems and Foliage
  14. -
+
Prevent Plant Disease by following these steps:
+

+ { }; export default AIEngine; -*/} \ No newline at end of file diff --git a/frontend/src/components/Disease.jsx b/frontend/src/components/Disease.jsx index 53682109..2160ae05 100644 --- a/frontend/src/components/Disease.jsx +++ b/frontend/src/components/Disease.jsx @@ -1,11 +1,11 @@ import React, { useEffect, useState } from "react"; import Spinner from "./Spinner"; import { Link } from "react-router-dom"; - +import { useNavigation } from "react-router-dom"; const Disease = () => { const [loading, setLoading] = useState(true); const [flipped, setFlipped] = useState(Array(14).fill(false)); // Create an array for each fruit's flip state - + // const navigate = useNavigation(); // Function to handle flipping individual cards const handleFlip = (index) => { const newFlipped = [...flipped]; @@ -19,133 +19,72 @@ const Disease = () => { }, 1000); return () => clearTimeout(timer); }, []); - - const fruits = [ - { - name: "Apple", - image: - "https://post.healthline.com/wp-content/uploads/2020/09/Do_Apples_Affect_Diabetes_and_Blood_Sugar_Levels-732x549-thumbnail-1-732x549.jpg", - content: `Apple Scab: Fungal disease causing black or brown lesions on leaves and fruit. - Fire Blight: Bacterial infection that causes branches and fruit to wither and die. - Powdery Mildew: Fungal disease that forms white powdery spots on leaves, buds, and fruit. - Cedar Apple Rust: Fungal disease leading to bright orange lesions on leaves and fruit.`, - }, - { - name: "Blueberry", - image: - "https://www.supermarketperimeter.com/ext/resources/0430-blueberries.png?t=1588260305&width=1080", - content: `Mummy Berry: A fungal disease that causes fruit to shrivel and drop prematurely. - Botrytis Blight (Gray Mold): Causes rotting of the flowers, fruit, and leaves. - Anthracnose: Leads to leaf spots and fruit rot. - Blueberry Rust: Causes orange pustules on the undersides of leaves.`, - }, + + const crops = [ { - name: "Cherry", - image: - "https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/slideshows/health_benefits_of_cherries_slideshow/1800x1200_health_benefits_of_cherries_slideshow.jpg", - content: `Cherry Leaf Spot: Fungal disease causing yellowing and premature leaf drop. - Brown Rot: Fungal infection that rots fruit and affects blossoms and twigs. - Bacterial Canker: Causes sunken, oozing lesions on twigs and fruit. - Powdery Mildew: Leads to white, powdery growth on leaves and fruit.`, + "id": 1, + "name": "Sugarcane", + "image": "https://cdn.pixabay.com/photo/2020/07/09/20/00/sugarcane-5388614_640.jpg", + "content": "Mosaic: Yellow-green mottled leaves.
Red Rot: Stalk decay.
Rust: Orange pustules on leaves.
Yellow Leaf: Leaves turn yellow." }, { - name: "Corn", - image: - "https://m.media-amazon.com/images/I/41F62-VbHSL._AC_UF1000,1000_QL80_.jpg", - content: `Northern Corn Leaf Blight: Fungal disease causing large, tan lesions on leaves. - Common Rust: Fungal disease causing pustules on leaves. - Gray Leaf Spot: Causes rectangular gray-brown spots on leaves. - Corn Smut: Fungal infection that causes swollen galls on kernels.`, + "id": 2, + "name": "Apple", + "image": "https://post.healthline.com/wp-content/uploads/2020/09/Do_Apples_Affect_Diabetes_and_Blood_Sugar_Levels-732x549-thumbnail-1-732x549.jpg", + "content": "Scab: Dark spots on leaves.
Fire Blight: Branches wither.
Powdery Mildew: White spots on leaves.
Cedar Rust: Orange lesions on fruit." }, { - name: "Grape", - image: "https://i.ndtvimg.com/i/2015-09/grapes_625x350_61443376353.jpg", - content: `Powdery Mildew: White, powdery growth on leaves and fruit. - Downy Mildew: Yellowish spots on leaves with fuzzy growth on undersides. - Botrytis Bunch Rot: Gray mold that causes rot on fruit clusters. - Black Rot: Causes black lesions on leaves, stems, and fruit.`, + "id": 3, + "name": "Blueberry", + "image": "https://www.supermarketperimeter.com/ext/resources/0430-blueberries.png?t=1588260305&width=1080", + "content": "Mummy Berry: Fruit shrivels.
Gray Mold: Flowers and fruit rot.
Anthracnose: Spots on leaves.
Rust: Orange pustules under leaves." }, { - name: "Orange", - image: - "https://www.irishtimes.com/polopoly_fs/1.3923226.1560339148!/image/image.jpg_gen/derivatives/ratio_1x1_w1200/image.jpg", - content: `Citrus Canker: Bacterial disease causing raised, corky lesions on fruit, leaves, and twigs. - Greasy Spot: Fungal disease causing oily-looking lesions on leaves. - Huanglongbing (Citrus Greening): Bacterial disease causing yellowing leaves and misshapen fruit. - Anthracnose: Causes leaf and fruit lesions, often after wet conditions.`, + "id": 4, + "name": "Cherry", + "image": "https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/slideshows/health_benefits_of_cherries_slideshow/1800x1200_health_benefits_of_cherries_slideshow.jpg", + "content": "Leaf Spot: Leaves yellow and drop.
Brown Rot: Fruit rot.
Canker: Lesions on twigs.
Powdery Mildew: White spots on leaves." }, { - name: "Peach", - image: - "https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/articles/health_tools/the_health_benefits_of_peaches_slideshow/thinkstock_rf_peaches.jpg?resize=650px:*", - content: `Peach Leaf Curl: Fungal disease causing puckered, curled, and discolored leaves. - Brown Rot: Fungal infection that causes fruit rot and blossom blight. - Bacterial Spot: Causes small, water-soaked lesions on fruit and leaves. - Cytospora Canker: Fungal disease that causes sunken cankers on branches.`, + "id": 5, + "name": "Corn", + "image": "https://m.media-amazon.com/images/I/41F62-VbHSL._AC_UF1000,1000_QL80_.jpg", + "content": "Leaf Blight: Tan lesions on leaves.
Rust: Pustules on leaves.
Gray Spot: Rectangular spots.
Smut: Galls on kernels." }, { - name: "Pepper Bell", - image: - "https://upload.wikimedia.org/wikipedia/commons/8/85/Green-Yellow-Red-Pepper-2009.jpg", - content: `Bacterial Spot: Causes small, dark lesions on leaves and fruit. - Anthracnose: Leads to dark, sunken lesions on fruit. - Phytophthora Blight: Causes stem rot, root rot, and fruit rot. - Powdery Mildew: A white fungal growth on leaves and stems.`, + "id": 6, + "name": "Grape", + "image": "https://i.ndtvimg.com/i/2015-09/grapes_625x350_61443376353.jpg", + "content": "Powdery Mildew: White growth.
Downy Mildew: Yellow spots.
Bunch Rot: Mold on fruit.
Black Rot: Lesions on fruit." }, { - name: "Potato", - image: - "https://m.economictimes.com/thumb/height-450,width-600,imgsize-111140,msid-72862126/potato-getty.jpg", - content: `Late Blight: A fungal-like pathogen causing blackened leaves and tuber rot. - Early Blight: Causes brown spots with concentric rings on leaves and tubers. - Blackleg: A bacterial disease causing dark, mushy stems and tubers. - Common Scab: Bacterial disease causing rough, scabby lesions on tubers.`, + "id": 7, + "name": "Orange", + "image": "https://www.irishtimes.com/polopoly_fs/1.3923226.1560339148!/image/image.jpg_gen/derivatives/ratio_1x1_w1200/image.jpg", + "content": "Citrus Canker: Corky lesions on fruit.
Greasy Spot: Oily lesions on leaves.
Huanglongbing: Yellow leaves
Anthracnose: Lesions on fruit, leaves." }, { - name: "Raspberry", - image: - "https://i0.wp.com/cdn-prod.medicalnewstoday.com/content/images/articles/326/326272/raspberries-with-ketones-in-a-bowl.jpg?w=1155&h=1541", - content: `Anthracnose: Causes small, dark lesions on canes and fruit. - Botrytis Fruit Rot (Gray Mold): Affects fruit, causing them to rot. - Phytophthora Root Rot: Causes wilting and root decay. - Powdery Mildew: Causes white, powdery growth on leaves and fruit.`, + "id": 8, + "name": "Peach", + "image": "https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/articles/health_tools/the_health_benefits_of_peaches_slideshow/thinkstock_rf_peaches.jpg?resize=650px:*", + "content": "Leaf Curl: Curled, discolored leaves.
Brown Rot: Fruit rot.
Spot: Small spots on fruit.
Canker: Sunken branch cankers." }, { - name: "Soybean", - image: - "https://m.economictimes.com/thumb/msid-66988154,width-1200,height-900,resizemode-4,imgsize-211276/soyabean-agencies.jpg", - content: `Soybean Cyst Nematode: A microscopic worm that affects roots and reduces yield. - Frogeye Leaf Spot: Causes circular, brown spots on leaves. - Sudden Death Syndrome (SDS): Fungal disease causing leaf yellowing and root rot. - Brown Stem Rot: A fungal disease affecting stems and roots.`, + "id": 9, + "name": "Pepper Bell", + "image": "https://upload.wikimedia.org/wikipedia/commons/8/85/Green-Yellow-Red-Pepper-2009.jpg", + "content": "Bacterial Spot: Dark spots on fruit.
Anthracnose: Sunken lesions.
Blight: Stem rot.
Powdery Mildew: White growth." }, { - name: "Squash", - image: - "https://post.healthline.com/wp-content/uploads/2020/08/squash-fruit-or-vegetable-732x549-thumbnail-732x549.jpg", - content: `Powdery Mildew: White powdery growth on leaves. - Downy Mildew: Yellow patches on leaves with fuzzy growth underneath. - Squash Vine Borer: Insect that bores into stems causing wilting. - Cucumber Mosaic Virus: Causes mottled leaves and distorted fruit.`, - }, - { - name: "Strawberry", - image: "https://images.indianexpress.com/2020/02/strawberry-1200.jpg", - content: `Gray Mold: Fungal disease that causes fruit rot. - Powdery Mildew: White fungal growth on leaves and fruit. - Anthracnose: Causes dark, sunken lesions on fruit. - Leaf Spot: Small, dark spots on leaves and fruit.`, - }, - { - name: "Tomato", - image: - "https://images-prod.healthline.com/hlcmsresource/images/AN_images/tomatoes-1296x728-feature.jpg", - content: `Blossom End Rot: Causes black, sunken spots on the blossom end of the fruit. - Early Blight: Brown spots with concentric rings on leaves and fruit. - Late Blight: Fungal-like pathogen causing blackened leaves and fruit rot. - Tomato Mosaic Virus: Causes mottling and distortion of leaves.`, - }, - ]; + "id": 10, + "name": "Potato", + "image": "https://m.economictimes.com/thumb/height-450,width-600,imgsize-111140,msid-72862126/potato-getty.jpg", + "content": "Late Blight: Blackened leaves, tuber rot.
Early Blight: Spots on leaves.
Blackleg: Dark stems.
Scab: Rough tuber lesions." + } +]; + const handleCardClick = (route) => { + navigate(route); // Navigate to the specified route + }; return (
@@ -155,40 +94,32 @@ const Disease = () => {

- 🍁Plant Disease Detection🍁 + 🍁Crop Disease Detection🍁

- This AI Engine Will Help To Detect Disease From Following Fruits - And Veggies + Select the crop you wish to receive disease detection assistance for, and empower your farming decisions with advanced insights!

-
- - - AI Engine - -
-
- {fruits.map((fruit, index) => ( -
+ {crops.map((crop, index) => ( + handleCardClick('/engine') + } >
{fruit.name} handleFlip(index)} onClick={() => handleFlip(index)} className="w-full h-48 object-cover rounded-lg mb-4" /> -

- {fruit.name} +

+ {crop.name}

{ onClick={() => handleFlip(index)} className="w-full h-64 rounded-xl [transform:rotateY(180deg)] [backface-visibility:hidden] absolute inset-0 bg-green-200 flex justify-center items-center" > -

{`${fruit.content}`}

+

-
+ ))}
diff --git a/frontend/src/components/Submit.jsx b/frontend/src/components/Submit.jsx index e915fe8c..36b04635 100644 --- a/frontend/src/components/Submit.jsx +++ b/frontend/src/components/Submit.jsx @@ -4,11 +4,17 @@ import { useLocation, Navigate } from 'react-router-dom'; const Submit = () => { const location = useLocation(); const result = location.state?.result; - + const id = location.state?.id; if (!result) { return ; } - + if (id == 1) + return (
+

Sugarcane Disease Prediction

+

+ This page will display the results for the sugarcane disease prediction model. +

+
) const { title, desc, prevent, image_url, pred, sname, simage, buy_link } = result; return (