diff --git a/app/routes/team_.$name/route.tsx b/app/routes/team_.$name/route.tsx
index a4ba47f6..7b587fdc 100644
--- a/app/routes/team_.$name/route.tsx
+++ b/app/routes/team_.$name/route.tsx
@@ -4,17 +4,27 @@ import TibetanTeam from "~/helper/teamData/bo.json";
import EnglishTeam from "~/helper/teamData/en.json";
import { FaLinkedinIn } from "react-icons/fa6";
import type { LoaderFunction } from "@remix-run/node";
+import ToolWraper from "~/component/ToolWraper";
// load the name from the URL
-export const loader: LoaderFunction = async ({ params }) => {
- return { name: params.name };
+export const loader: LoaderFunction = async ({ request, params }) => {
+ const url = new URL(request.url);
+ const pathname = url.pathname;
+ const name = params.name;
+
+ const userDetails = EnglishTeam.find((member) => member.route === name);
+ const subRoute = { name: userDetails?.name, route: pathname, subRoute: name };
+
+ return { name, subRoute };
};
function TeamDetailsPage() {
let { translation, isTibetan } = uselitteraTranlation();
- const { name } = useLoaderData();
+ const { name, subRoute } = useLoaderData();
- const userDetails = EnglishTeam.find((member) => member.route === name);
+ const teamData = isTibetan ? TibetanTeam : EnglishTeam;
+
+ const userDetails = teamData.find((member) => member.route === name);
return (
-
-
-
- {userDetails?.linkedInId !== "" && (
-
-
Find them online:
-
-
-
+
+
+
+
+ {userDetails?.linkedInId !== "" && (
+
+
Find them online:
+
+
+
+
+ )}
+
+
+
{userDetails?.name}
+
{userDetails?.designation}
+
+
{userDetails?.bios}
+
{userDetails?.educationalProfessionalBackground}
- )}
-
-
-
{userDetails?.name}
-
{userDetails?.designation}
-
-
{userDetails?.bios}
-
{userDetails?.educationalProfessionalBackground}
-
+
);
}