From 56552f1057e01d45c2a184c65cb74d2a590ef280 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Sun, 11 May 2025 23:52:39 +0330 Subject: [PATCH] set data ssr in page dashboard --- app/dashboard/page.js | 33 ++++------------------------ components/dashboard/Content.js | 38 +++++++++++++++++++++++++++++++++ components/dashboard/index.js | 2 ++ 3 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 components/dashboard/Content.js diff --git a/app/dashboard/page.js b/app/dashboard/page.js index 668df26..a001ee6 100644 --- a/app/dashboard/page.js +++ b/app/dashboard/page.js @@ -1,36 +1,11 @@ -"use client"; - -import { useState } from "react"; - -import userData from "@/data/userData.json"; -import DashboardPage from "@/components/dashboard"; -import UserAccountPage from "@/components/dashboard/userAccount/UserAccount"; +import Content from "@/components/dashboard/Content"; +import { getStateInfo } from "@/lib/getStateInfo"; function UserAccount() { - const [value, setValue] = useState(0); - const [isOpenSide, setIsOpenSide] = useState(false); - const [isTurnsDetails, setIsTurnsDetails] = useState(false); + const { matchedCity } = getStateInfo(); return ( - - - + ); } diff --git a/components/dashboard/Content.js b/components/dashboard/Content.js new file mode 100644 index 0000000..65c1377 --- /dev/null +++ b/components/dashboard/Content.js @@ -0,0 +1,38 @@ +"use client"; + +import { useState } from "react"; + +import userData from "@/data/userData.json"; +import DashboardPage from "@/components/dashboard"; +import UserAccountPage from "@/components/dashboard/userAccount/UserAccount"; + +function Content({ matchedCity }) { + const [value, setValue] = useState(0); + const [isOpenSide, setIsOpenSide] = useState(false); + const [isTurnsDetails, setIsTurnsDetails] = useState(false); + + return ( + + + + ); +} + +export default Content; diff --git a/components/dashboard/index.js b/components/dashboard/index.js index 659ea39..34603b3 100644 --- a/components/dashboard/index.js +++ b/components/dashboard/index.js @@ -9,6 +9,7 @@ function DashboardPage({ setValue, isOpenSide, setIsOpenSide, + matchedCity }) { return (