inogen/app/admin/pages/DashboardPage.tsx
2026-10-18 18:12:59 +03:30

36 lines
1.9 KiB
TypeScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Link } from "react-router";
import { sections } from "../components/AppShell";
import { PageTitle } from "../components/Ui";
import { useDeploymentProfile } from "../deployment/DeploymentProfileContext";
const descriptions: Record<string, string> = {
"/admin/projects": "ثبت و ویرایش پروژه‌ها و جزئیات نوآوری",
"/admin/reference-data": "مدیریت مضامین و ارزش‌های نوآوری",
"/admin/ideas": "ایده‌ها، مقاله‌ها و اختراع‌ها",
"/admin/ecosystem": "بازیگران و ارتباطات زیست‌بوم",
"/admin/financial": "سال مالی و اطلاعات فصل‌ها",
"/admin/content": "انتشارات، رویدادها، کتاب‌ها و نوآوران",
"/admin/imports": "قالب، پیش‌نمایش و ثبت اکسل",
"/admin/users": "کاربران و نقش‌های دسترسی",
"/admin/account": "تغییر رمز و تنظیمات امنیتی",
};
export function DashboardPage() {
const { profile } = useDeploymentProfile();
const modules = sections.filter((item) => item.to !== "/" && profile.features.adminModules.includes(item.id));
return <>
<PageTitle title="صفحه اصلی" description="دسترسی سریع به همه ماژول‌های پنل راهبر"/>
<section aria-labelledby="modules-title">
<div className="dashboard-section-title"><div><h3 id="modules-title">ماژول‌های سامانه</h3><p>هر بخش از اینجا و منوی اصلی در دسترس است.</p></div></div>
<div className="module-grid">
{modules.map(({ to, label, icon: Icon }) => <Link className="module-card" to={to} key={to}>
<span className="module-icon"><Icon size={24}/></span>
<span><strong>{label}</strong><small>{descriptions[to]}</small></span>
</Link>)}
</div>
</section>
</>;
}