refactor: only a small tweak

This commit is contained in:
rusconn
2023-06-24 18:26:26 +09:00
parent b904f2e71e
commit 8d658855ac
2 changed files with 2 additions and 6 deletions

View File

@@ -9,9 +9,7 @@ import { toolGroups } from "@/config/tools";
import { ToolGroup } from "./tool-group"; import { ToolGroup } from "./tool-group";
const isGroupedTool = (path: string) => const isGroupedTool = (path: string) =>
Object.values(toolGroups) Object.values(toolGroups).some(({ href }) => path.startsWith(`${href}/`));
.map(({ href }) => href as string)
.some(group => path.startsWith(`${group}/`));
export function ToolGroups() { export function ToolGroups() {
const pathname = usePathname(); const pathname = usePathname();

View File

@@ -1,6 +1,4 @@
import { clsx, type ClassValue } from "clsx"; import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
return twMerge(clsx(inputs));
}