summaryrefslogtreecommitdiff
path: root/lib/utils.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2025-01-06 23:48:56 -0800
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2025-01-06 23:48:56 -0800
commitb97f3b42e1bad5753728315b5c7ebdacf6f81172 (patch)
treea07cbc723346503792a70ca7c923a8838e64fdff /lib/utils.ts
downloadpenguin-new-tab-b97f3b42e1bad5753728315b5c7ebdacf6f81172.tar.gz
penguin-new-tab-b97f3b42e1bad5753728315b5c7ebdacf6f81172.zip
initial commit
Diffstat (limited to 'lib/utils.ts')
-rw-r--r--lib/utils.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/utils.ts b/lib/utils.ts
new file mode 100644
index 0000000..e70557a
--- /dev/null
+++ b/lib/utils.ts
@@ -0,0 +1,21 @@
+import { clsx, type ClassValue } from "clsx";
+import { twMerge } from "tailwind-merge";
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
+
+export function greet(name: string, time: Date) {
+ const messages: [number, number, string][] = [
+ [0, 4, "🌕 Good night"],
+ [5, 11, "🌤️ Good morning"], //Store messages in an array
+ [12, 17, "🌷͙ Good afternoon"],
+ [18, 23, "🌕 Good night"],
+ ];
+
+ const message = messages.find(
+ ([start, end]) => time.getHours() >= start && time.getHours() <= end
+ );
+
+ return (message ? message[2] : "Hello") + ", " + name + ".";
+}