"use client";
import { useState } from "react";
import { usePathname } from "next/navigation";
import { Github, Key, BookOpen, User, Plus } from "lucide-react";
import Link from "next/link";
import { ApiKeyModal } from "@/components/api-key-modal";
import { SignInButton, SignedIn, SignedOut, useAuth } from "@clerk/nextjs";
import { useApiKey } from "@/hooks/use-api-key";
export function Navbar() {
const [showApiModal, setShowApiModal] = useState(false);
const { isLoaded } = useAuth();
const pathname = usePathname();
const [, setApiKey] = useApiKey();
const handleApiKeySubmit = (key: string) => {
setApiKey(key);
setShowApiModal(false);
};
const isOnStoriesPage = pathname === "/stories";
if (!isLoaded) return null;
return (
<>
setShowApiModal(false)}
onSubmit={handleApiKeySubmit}
/>
>
);
}