Initial commit: snakkimo CMT
React + Vite + Tailwind dashboard with: - Login (JWT via snakkimo auth) - Dashboard with Datenbankverwaltung + Contentverwaltung tiles - Table overview with record counts (total, published, blocked) - Table record viewer with text/status filters and linked field navigation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
40
src/components/Layout.jsx
Normal file
40
src/components/Layout.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { getUser, logout } from '../lib/api';
|
||||
|
||||
export default function Layout({ children, back }) {
|
||||
const navigate = useNavigate();
|
||||
const user = getUser();
|
||||
|
||||
function handleLogout() {
|
||||
logout();
|
||||
navigate('/login');
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-slate-100">
|
||||
<header className="bg-indigo-700 text-white px-6 py-3 flex items-center justify-between shadow">
|
||||
<div className="flex items-center gap-3">
|
||||
{back && (
|
||||
<button
|
||||
onClick={() => navigate(back)}
|
||||
className="text-indigo-200 hover:text-white text-sm mr-1"
|
||||
>
|
||||
← Zurück
|
||||
</button>
|
||||
)}
|
||||
<span className="text-xl font-bold tracking-tight">🐟 snakkimo CMT</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-4 text-sm">
|
||||
<span className="text-indigo-200">{user?.email}</span>
|
||||
<button
|
||||
onClick={handleLogout}
|
||||
className="bg-indigo-600 hover:bg-indigo-500 px-3 py-1 rounded-lg transition-colors"
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<main className="p-6">{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user