36 lines
1.9 KiB
TypeScript
36 lines
1.9 KiB
TypeScript
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>
|
||
</>;
|
||
}
|
||
|
||
|