INSIGHT-MVP/packages/frontend/src/admin/AdminLayout.tsx
Thomas Reitz 3f919340b5 feat: Stammdaten, CRM Reporting, Hilfesystem (hohe Priorität)
Stammdaten (Kapitel 14):
- 5 neue Prisma-Modelle: Department, Location, CostCenter, JobTitle, SkillCategory
- MasterDataModule (Core Service): vollständiges CRUD + öffentliche Dropdown-Endpoints
- Admin-UI /admin/master-data mit 5 Tabs, Inline-Edit, Farbwahl (Skill-Kategorien)

CRM Reporting (Kapitel 22.9):
- recharts ^2.12.0 installiert
- Deals: GET /deals/stats (Win/Loss-Rate, Umsatz, Trend, Verlustgründe)
- Aktivitäten: GET /activities/stats (nach Typ, Completion-Rate, offene Tasks)
- Reports-Seite /crm/reports: LineChart, PieChart, BarChart mit Zeitraum-Filter

Hilfesystem (Kapitel 16):
- @anthropic-ai/sdk installiert; ANTHROPIC_API_KEY optional in .env
- HelpModule (Core Service): POST /help/chat via Claude Haiku
- HelpTooltip-Komponente: Hover-Tooltip für Formularfelder
- HelpPanel: seitlicher Drawer mit Seitenkontext + KI-Chat
- -Button im Topbar (AppLayout), pageKey aus Route abgeleitet

Migration erforderlich: prisma migrate deploy (core-service)
Deployment: core rebuild, crm rebuild, frontend rebuild

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 10:39:30 +01:00

67 lines
1.9 KiB
TypeScript

import { Outlet, NavLink, useNavigate } from 'react-router-dom';
import styles from './AdminLayout.module.css';
const tabs = [
{ to: '/admin/users', label: 'Benutzer' },
{ to: '/admin/sso', label: 'SSO-Konfiguration' },
{ to: '/admin/external-links', label: 'Externe Links' },
{ to: '/admin/customize', label: 'Anpassungen' },
{ to: '/admin/company', label: 'Firmendaten' },
{ to: '/admin/events', label: 'Events' },
{ to: '/admin/ssl', label: 'SSL / Domain' },
{ to: '/admin/profile-access', label: 'Profilzugriff' },
{ to: '/admin/crm-settings', label: 'CRM Sichtbarkeit' },
{ to: '/admin/master-data', label: 'Stammdaten' },
];
export function AdminLayout() {
const navigate = useNavigate();
return (
<div>
{/* Header mit Zurück-Button und Tabs */}
<div className={styles.header}>
<div className={styles.headerTop}>
<button
className={styles.backButton}
onClick={() => navigate('/')}
>
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M10 12L6 8l4-4" />
</svg>
Zurück zum Dashboard
</button>
<h1 className={styles.title}>Administration</h1>
</div>
<nav className={styles.tabs}>
{tabs.map((tab) => (
<NavLink
key={tab.to}
to={tab.to}
className={({ isActive }) =>
`${styles.tab} ${isActive ? styles.tabActive : ''}`
}
>
{tab.label}
</NavLink>
))}
</nav>
</div>
{/* Content */}
<div className={styles.content}>
<Outlet />
</div>
</div>
);
}