UploadFile / frontend /src /components /NavbarPublic.tsx
ddosvn's picture
Deploy Upload ThTuanIT Full-stack (Go + Next.js + Python hf_xet + MongoDB)
7c5da52 verified
Raw History Blame Contribute Delete
4.07 kB
"use client";
import React from "react";
import Link from "next/link";
import { ArrowRight, LayoutGrid, CloudUpload } from "lucide-react";
import { useCloud } from "@/context/CloudContext";
import { ToastStack } from "@/components/GlobalModals";
export function NavbarPublic() {
const { healthOk, currentUser, toasts } = useCloud();
return (
<>
<header className="sticky top-0 z-40 glass border-b border-white/10">
<div className="max-w-7xl mx-auto px-4 sm:px-8 h-20 flex items-center justify-between">
<Link href="/" className="flex items-center gap-3.5 group">
<div className="w-11 h-11 rounded-2xl bg-gradient-to-br from-indigo-500 via-purple-500 to-amber-500 p-[1px] shadow-lg shadow-indigo-500/25 group-hover:scale-105 transition">
<div className="w-full h-full bg-slate-950 rounded-[15px] flex items-center justify-center text-indigo-400">
<CloudUpload className="w-6 h-6" />
</div>
</div>
<div>
<div className="flex items-center gap-2">
<span className="font-extrabold text-lg tracking-tight text-white">Upload ThTuanIT</span>
<span className="text-[10px] font-mono font-bold uppercase px-2 py-0.5 rounded-full bg-indigo-500/20 text-indigo-300 border border-indigo-500/30">
Cloud Pro
</span>
</div>
<p className="text-[11px] text-slate-400 font-mono">Nền tảng Lưu trữ & Chia sẻ Tệp Siêu Tốc</p>
</div>
</Link>
<nav aria-label="Điều hướng chính" className="hidden md:flex items-center gap-7 text-sm font-medium text-slate-300">
<Link href="/#architecture" className="hover:text-white transition">
Công nghệ Turbo
</Link>
<Link href="/#rbac" className="hover:text-white transition">
Phân quyền RBAC
</Link>
<Link href="/#faq" className="hover:text-white transition">
Câu hỏi thường gặp
</Link>
<Link href="/developers" className="hover:text-white transition">
Tài liệu API
</Link>
<div className="flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/25 text-xs font-mono text-emerald-300">
<span className={`w-2 h-2 rounded-full ${healthOk ? "bg-emerald-400 animate-pulse" : "bg-rose-500"}`} />
<span>ThTuanIT Storage</span>
</div>
</nav>
<div className="flex items-center gap-3">
{currentUser ? (
<Link
href="/dashboard"
className="px-5 py-2.5 rounded-xl bg-gradient-to-r from-indigo-600 via-violet-600 to-indigo-600 hover:from-indigo-500 hover:to-violet-500 text-xs sm:text-sm font-semibold text-white shadow-lg shadow-indigo-600/30 transition flex items-center gap-2"
>
<LayoutGrid className="w-4 h-4" />
<span>Vào Workspace (@{currentUser.username})</span>
</Link>
) : (
<>
<Link
href="/login"
className="px-4 py-2.5 rounded-xl text-xs sm:text-sm font-semibold text-slate-200 hover:text-white hover:bg-white/5 transition"
>
Đăng nhập
</Link>
<Link
href="/register"
className="px-5 py-2.5 rounded-xl bg-gradient-to-r from-indigo-600 via-violet-600 to-indigo-600 hover:from-indigo-500 hover:to-violet-500 text-xs sm:text-sm font-semibold text-white shadow-lg shadow-indigo-600/30 transition flex items-center gap-2"
>
<span>Đăng ký miễn phí</span>
<ArrowRight className="w-4 h-4" />
</Link>
</>
)}
</div>
</div>
</header>
<ToastStack toasts={toasts} />
</>
);
}