"use client"; import React from "react"; import { usePathname } from "next/navigation"; type Props = { domain: string; }; export function AddressBar({ domain }: Props) { const pathname = usePathname(); return (
{domain}
{pathname ? ( <> / {pathname .split("/") .slice(1) .filter((s) => !!s) .map((segment) => { return ( {segment} / ); })} ) : null}
); }