luom2645's picture
Upload folder using huggingface_hub
9dd9a58 verified
Raw History Blame
1.31 kB
import React, { useState } from 'react';
import Sidebar from './Sidebar';
import CreationCenter from '../Sections/CreationCenter';
import ProjectManagement from '../Sections/ProjectManagement';
import AIModels from '../Sections/AIModels';
import Settings from '../Sections/Settings';
import AdminPanel from '../Sections/AdminPanel';
import { useAuth } from '../../hooks/useAuth';
const Layout: React.FC = () => {
const [activeSection, setActiveSection] = useState('creation');
const { user } = useAuth();
const renderSection = () => {
switch (activeSection) {
case 'creation':
return <CreationCenter />;
case 'projects':
return <ProjectManagement />;
case 'ai-models':
return <AIModels />;
case 'settings':
return <Settings />;
case 'admin':
return user?.role === 'admin' ? <AdminPanel /> : <CreationCenter />;
default:
return <CreationCenter />;
}
};
return (
<div className="flex min-h-screen bg-primary-bg">
<Sidebar
activeSection={activeSection}
onSectionChange={setActiveSection}
/>
<main className="flex-1 ml-80 p-8">
<div className="max-w-7xl mx-auto">
{renderSection()}
</div>
</main>
</div>
);
};
export default Layout;