"use client"; import { cn } from "@/lib/utils"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Fragment } from "react"; import { CopyButton } from "./copy-button"; export function SubNav({ className, ...props }: React.ComponentProps<"div">) { const pathname = usePathname(); const segments = pathname.split("/").filter(Boolean).slice(0, -1); return (
{segments.map((segment, index) => ( {segment} {index < segments.length - 1 ? ( {" | "} ) : null} ))}
); }