'use client'; import React from 'react'; import dynamic from 'next/dynamic'; import { AnimatePresence, motion } from 'framer-motion'; import { Dashboard } from './dashboard'; import { useCabinet } from '../lib/hooks/useCabinet'; import { MOCK_USER, MOCK_STATS } from '../lib/mock'; import type { CabinetSection } from '../lib/types'; // ─── Lazy sections (separate JS chunks) ─────────────────────────────────────── const Skeleton = () => (
{Array.from({ length: 4 }).map((_, i) => (
))}
); const PlagiatTable = dynamic( () => import('./tables/PlagiatTable').then((m) => ({ default: m.PlagiatTable })), { loading: Skeleton }, ); const SiTable = dynamic( () => import('./tables/SiTable').then((m) => ({ default: m.SiTable })), { loading: Skeleton }, ); const PaymentsTable = dynamic( () => import('./tables/PaymentsTable').then((m) => ({ default: m.PaymentsTable, })), { loading: Skeleton }, ); const ProfileSection = dynamic( () => import('./profile').then((m) => ({ default: m.ProfileSection })), { loading: Skeleton }, ); // ─── Section switcher ────────────────────────────────────────────────────────── function SectionContent({ section }: { section: CabinetSection }) { switch (section) { case 'dashboard': return ; case 'plagiat': return ; case 'si': return ; case 'payments': return ; case 'profile': return ; } } // ─── Animation ──────────────────────────────────────────────────────────────── const FADE = { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -6 }, transition: { duration: 0.18, ease: 'easeOut' }, } as const; // ─── CabinetLayout ──────────────────────────────────────────────────────────── export const CabinetLayout: React.FC = () => { const { activeSection } = useCabinet(); return (
); };