All files / src/components/layout Navbar.tsx

100% Statements 29/29
100% Branches 2/2
100% Functions 1/1
100% Lines 29/29

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351x 1x   109x 109x   109x 109x 109x 109x 109x 109x 109x 109x 109x 109x 109x 109x 109x 109x 109x   109x 109x 109x 109x 109x   109x 109x 109x 109x   109x  
import { useAuthStore } from "../../stores/authStore";
import { Link } from "react-router-dom";
 
export default function Navbar() {
  const { user, logout } = useAuthStore();
 
  return (
    <nav className="border-b border-gray-200 bg-white px-6 py-3">
      <div className="flex items-center justify-between">
        <Link className="flex items-center gap-2" to={"/"}>
          <div className="h-7 w-7 pt-1">
            <img src="/favicon.svg" alt="Uptime Monitor" />
          </div>
          <span className="font-semibold text-gray-900">Uptime Monitor</span>
        </Link>
        <div className="flex items-center gap-4">
          <span className="text-sm text-gray-600">{user?.email}</span>
          <Link
            to="/settings"
            className="rounded-md px-3 py-1.5 text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100"
          >
            Settings
          </Link>
          <button
            onClick={logout}
            className="rounded-md px-3 py-1.5 text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100 cursor-pointer"
          >
            Logout
          </button>
        </div>
      </div>
    </nav>
  );
}