"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";
export function Navbar() {
const [showApiModal, setShowApiModal] = useState(false);
const { isLoaded } = useAuth();
const pathname = usePathname();
const handleApiKeySubmit = (key: string) => {
localStorage.setItem("together_api_key", key);
setShowApiModal(false);
};
const isOnStoriesPage = pathname === "/stories";
if (!isLoaded) return null;
return (
<>
setShowApiModal(false)}
onSubmit={handleApiKeySubmit}
/>
>
);
}