Simple React page
This commit is contained in:
34
app/page.tsx
34
app/page.tsx
@@ -1,11 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
type Task = { id: string; title: string; status: string; assignee: string };
|
||||
type CronJob = { name: string; enabled: boolean; status: string };
|
||||
|
||||
export default function MissionControl() {
|
||||
export default function Page() {
|
||||
const [tab, setTab] = useState('tasks');
|
||||
const [data, setData] = useState<any>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -18,23 +13,22 @@ export default function MissionControl() {
|
||||
.catch(() => setLoading(false));
|
||||
}, [tab]);
|
||||
|
||||
return (
|
||||
<div style={{ minHeight: '100vh', background: '#0a0a0f', color: '#fff', padding: '20px', fontFamily: 'monospace' }}>
|
||||
<h1 style={{ fontSize: '24px', marginBottom: '20px' }}>MISSION CONTROL</h1>
|
||||
const tabs = ['tasks','crons','server','backups','agents','whatsapp','memory'];
|
||||
|
||||
<div style={{ display: 'flex', gap: '10px', marginBottom: '20px', flexWrap: 'wrap' }}>
|
||||
{['tasks', 'crons', 'server', 'backups', 'agents', 'whatsapp', 'memory'].map(t => (
|
||||
<button key={t} onClick={() => setTab(t)} style={{ padding: '10px 20px', background: tab === t ? '#ff0050' : '#333', color: '#fff', border: 'none', borderRadius: '5px', cursor: 'pointer' }}>{t}</button>
|
||||
return (
|
||||
<div style={{background:'#000',minHeight:'100vh',color:'#fff',fontFamily:'monospace',padding:'20px'}}>
|
||||
<h1 style={{fontSize:'20px',marginBottom:'15px'}}>MISSION CONTROL</h1>
|
||||
<div style={{display:'flex',gap:'5px',flexWrap:'wrap',marginBottom:'15px'}}>
|
||||
{tabs.map(t => (
|
||||
<button key={t} onClick={()=>setTab(t)} style={{
|
||||
padding:'8px 12px',background:tab===t?'#f0f': '#333',
|
||||
color:'#fff',border:'none',borderRadius:'4px',fontSize:'12px'
|
||||
}}>{t}</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
<p>Loading...</p>
|
||||
) : (
|
||||
<pre style={{ background: '#111', padding: '20px', borderRadius: '10px', overflow: 'auto', maxHeight: '70vh' }}>
|
||||
{JSON.stringify(data, null, 2)}
|
||||
</pre>
|
||||
)}
|
||||
<pre style={{background:'#111',padding:'15px',borderRadius:'8px',overflow:'auto'}}>
|
||||
{loading ? 'Loading...' : JSON.stringify(data,null,2)}
|
||||
</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user