Skip to content

Commit

Permalink
fix(lib): update lib utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mbellamj committed May 2, 2024
1 parent 0410dd8 commit 5766e5b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
import { IconName } from "@/core/interfaces/icon.interface";
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
return twMerge(clsx(inputs));
}

export const getIcon = (text: string): IconName => {
switch (text.toLowerCase()) {
case "dashboard":
return "layout-dashboard";
case "analytics":
return "line-chart";
case "settings":
return "settings";
case "tokens":
return "dollar-sign";
default:
return "home";
}
};

export const fetcher = (...args: Parameters<typeof fetch>) =>
fetch(...args).then((res) => res.json());

0 comments on commit 5766e5b

Please sign in to comment.