From 89af132577d95059af7cfcef07487f8e82417b92 Mon Sep 17 00:00:00 2001 From: Atharva Date: Sat, 22 Feb 2025 23:49:05 +0530 Subject: [PATCH] Added Dynamic routing on the table name --- Frontend/src/components/Td.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Frontend/src/components/Td.jsx b/Frontend/src/components/Td.jsx index a64e5bf..1c26a00 100644 --- a/Frontend/src/components/Td.jsx +++ b/Frontend/src/components/Td.jsx @@ -1,10 +1,21 @@ +import { useNavigate } from "react-router-dom"; + const Td = ({ children }) => { - console.log(children); + const navigate = useNavigate(); return ( - {children.name} + { + console.log("Td", children._id); + navigate(`farmpage/${children._id}`); + }} + > + {children.name} + {children.location} {children.soilType} + {children.size}