Enhanced error handling in documentation and blog pages, to ensure smoother running and user experience. This also includes additional UI updates related to font selection, layout arrangement, and interactive elements on error pages, marketing pages, and general site navigation components. Moreover, a "contact us" feature has been added to error pages to help users seek assistance more conveniently.
38 lines
949 B
TypeScript
38 lines
949 B
TypeScript
'use client';
|
|
|
|
import Link from 'next/link';
|
|
import { usePathname } from 'next/navigation';
|
|
|
|
import { NavigationMenuItem } from '@kit/ui/navigation-menu';
|
|
import { cn, isRouteActive } from '@kit/ui/utils';
|
|
|
|
const getClassName = (path: string, currentPathName: string) => {
|
|
const isActive = isRouteActive(path, currentPathName);
|
|
|
|
return cn(
|
|
`text-sm font-medium px-2.5 py-2 border rounded-lg border-transparent transition-colors duration-100`,
|
|
{
|
|
'dark:text-gray-300 dark:hover:text-white': !isActive,
|
|
'dark:text-white text-current': isActive,
|
|
},
|
|
);
|
|
};
|
|
|
|
export function SiteNavigationItem({
|
|
path,
|
|
children,
|
|
}: React.PropsWithChildren<{
|
|
path: string;
|
|
}>) {
|
|
const currentPathName = usePathname();
|
|
const className = getClassName(path, currentPathName);
|
|
|
|
return (
|
|
<NavigationMenuItem key={path}>
|
|
<Link className={className} href={path}>
|
|
{children}
|
|
</Link>
|
|
</NavigationMenuItem>
|
|
);
|
|
}
|