refactor: reorganiza componentes compartilhados e caminhos do app

This commit is contained in:
Felipe Coutinho
2026-03-06 13:57:40 +00:00
parent f0497d5c5f
commit 069d0759c6
103 changed files with 225 additions and 622 deletions

View File

@@ -0,0 +1,31 @@
"use client";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils/ui";
import { NavLink } from "./nav-link";
import { linkActive, linkBase, linkIdle } from "./nav-styles";
type NavPillProps = {
href: string;
preservePeriod?: boolean;
children: React.ReactNode;
};
export function NavPill({ href, preservePeriod, children }: NavPillProps) {
const pathname = usePathname();
const isActive =
href === "/dashboard"
? pathname === href
: pathname === href || pathname.startsWith(`${href}/`);
return (
<NavLink
href={href}
preservePeriod={preservePeriod}
className={cn(linkBase, isActive ? linkActive : linkIdle)}
>
{children}
</NavLink>
);
}