initial commit
This commit is contained in:
40
web/src/App.jsx
Normal file
40
web/src/App.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { useState } from 'react';
|
||||
import { useAuth } from './hooks/useAuth';
|
||||
import Login from './components/Login';
|
||||
import Layout from './components/Layout';
|
||||
import JobList from './components/JobList';
|
||||
import JobSubmission from './components/JobSubmission';
|
||||
import RunnerList from './components/RunnerList';
|
||||
import AdminPanel from './components/AdminPanel';
|
||||
import './styles/index.css';
|
||||
|
||||
function App() {
|
||||
const { user, loading } = useAuth();
|
||||
const [activeTab, setActiveTab] = useState('jobs');
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center">
|
||||
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600"></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
return <Login />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout activeTab={activeTab} onTabChange={setActiveTab}>
|
||||
{activeTab === 'jobs' && <JobList />}
|
||||
{activeTab === 'submit' && (
|
||||
<JobSubmission onSuccess={() => setActiveTab('jobs')} />
|
||||
)}
|
||||
{activeTab === 'runners' && <RunnerList />}
|
||||
{activeTab === 'admin' && <AdminPanel />}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user