feat(panel): wire panel header/userDetail to real representation info

افزودن adaptRepresentationInfo که خروجی API نماینده را به propهای
کامپوننت‌های نمایشی map می‌کند و حذف import داده mock از Content پنل.
فیلدهای آماری بدون معادل API خالی می‌مانند (بدون داده ساختگی).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-14 23:57:48 +03:30
co-authored by Claude Opus 4.8
parent d513d2dd30
commit bef36f86ca
2 changed files with 26 additions and 3 deletions
+4 -3
View File
@@ -3,16 +3,17 @@
import { useEffect, useState } from "react";
import Header from "@/components/layoutPanel/header";
import Sidebar from "@/components/layoutPanel/sidebar";
import Information from "@/data/information.json";
import UserDetail from "@/components/layoutPanel/userDetail";
import { usePathname } from "next/navigation";
import BgGray from "@/components/layoutPanel/sidebar/BgGray";
import { adaptRepresentationInfo } from "@/helper";
function Content({ children, representationInfo }) {
const pathname = usePathname();
const [active, setActive] = useState(false);
const [open, setOpen] = useState(true);
const [loading, setLoading] = useState(true);
const info = adaptRepresentationInfo(representationInfo);
useEffect(() => {
setTimeout(() => {
@@ -43,7 +44,7 @@ function Content({ children, representationInfo }) {
`}
>
<Header
data={Information}
data={info}
setActive={setActive}
disableProfile={pathname.includes("dashboard")}
/>
@@ -53,7 +54,7 @@ function Content({ children, representationInfo }) {
</main>
{pathname.includes("dashboard") && (
<UserDetail
data={Information}
data={info}
loading={loading}
representationInfo={representationInfo}
/>