import { Settings } from "lucide-react"; import { IslandHost } from "@/client/server/IslandHost"; import { RefPickerIsland } from "@/client/islands/ref-picker"; import { PageHeader } from "@/client/components/ui/page-header"; function decodeRef(refEnc: string): string { try { return decodeURIComponent(refEnc); } catch { return refEnc; } } type RepoNavProps = { owner: string; repo: string; refEnc?: string; currentTab?: "browse" | "commits" | "admin"; showRefDropdown?: boolean; }; const tabBase = "inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800/40 hover:text-zinc-900 dark:hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500/50"; const tabActive = "inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium bg-accent-100/50 dark:bg-accent-900/20 text-accent-700 dark:text-accent-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500/50"; export function RepoNav({ owner, repo, refEnc, currentTab, showRefDropdown = true }: RepoNavProps) { const decodedRef = refEnc ? decodeRef(refEnc) : ""; return (
{owner} / {repo}
{refEnc ? (
) : (
)}
); }