[重构] 前端改造v1

This commit is contained in:
ryan
2026-03-11 12:47:08 +08:00
parent 052e3e98f8
commit 6eea676f8f
71 changed files with 3619 additions and 8791 deletions
+6
View File
@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
+14
View File
@@ -0,0 +1,14 @@
import { dashboardNavigation } from '@/lib/constants/navigation';
import type { NavigationItem } from '@/types/navigation';
export function isPathActive(pathname: string, href: string) {
if (href === '/') {
return pathname === '/';
}
return pathname === href || pathname.startsWith(`${href}/`);
}
export function getCurrentNavigationItem(pathname: string): NavigationItem | undefined {
return dashboardNavigation.find((item) => isPathActive(pathname, item.href));
}