Spaces:
Build error
Build error
Upload components/Layout.js with huggingface_hub
Browse files- components/Layout.js +37 -0
components/Layout.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useEffect } from 'react';
|
| 2 |
+
import { ShieldCheck } from 'lucide-react';
|
| 3 |
+
|
| 4 |
+
export default function Layout({ children }) {
|
| 5 |
+
useEffect(() => {
|
| 6 |
+
if ('serviceWorker' in navigator) {
|
| 7 |
+
navigator.serviceWorker.register('/sw.js')
|
| 8 |
+
.then(() => console.log('Service Worker Registered'))
|
| 9 |
+
.catch((err) => console.error('SW Error:', err));
|
| 10 |
+
}
|
| 11 |
+
}, []);
|
| 12 |
+
|
| 13 |
+
return (
|
| 14 |
+
<div className="flex flex-col h-screen w-full bg-telegram-bg text-telegram-text">
|
| 15 |
+
{/* Header */}
|
| 16 |
+
<header className="h-14 flex items-center justify-between px-4 bg-telegram-sidebar border-b border-gray-800 shadow-md z-10 shrink-0">
|
| 17 |
+
<div className="flex items-center gap-2">
|
| 18 |
+
<ShieldCheck className="text-telegram-accent encrypted-icon" size={24} />
|
| 19 |
+
<h1 className="font-bold text-lg tracking-wide">SecureChat</h1>
|
| 20 |
+
</div>
|
| 21 |
+
<a
|
| 22 |
+
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 23 |
+
target="_blank"
|
| 24 |
+
rel="noopener noreferrer"
|
| 25 |
+
className="text-xs text-telegram-secondary hover:text-telegram-accent transition-colors flex items-center gap-1 bg-white/5 px-2 py-1 rounded-full"
|
| 26 |
+
>
|
| 27 |
+
Built with anycoder
|
| 28 |
+
</a>
|
| 29 |
+
</header>
|
| 30 |
+
|
| 31 |
+
{/* Main Content Area */}
|
| 32 |
+
<main className="flex-1 flex overflow-hidden relative">
|
| 33 |
+
{children}
|
| 34 |
+
</main>
|
| 35 |
+
</div>
|
| 36 |
+
);
|
| 37 |
+
}
|