From cfa483c533061f6af8395b08d164e13d536e8e70 Mon Sep 17 00:00:00 2001 From: kenneth Date: Sun, 8 Mar 2026 02:06:29 +0000 Subject: [PATCH] feat(waitlist): add time-of-day greeting and duplicate email message Co-authored-by: Ona --- apps/waitlist-website/app/chat/message.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/waitlist-website/app/chat/message.ts b/apps/waitlist-website/app/chat/message.ts index b92e7d8..756dc18 100644 --- a/apps/waitlist-website/app/chat/message.ts +++ b/apps/waitlist-website/app/chat/message.ts @@ -11,6 +11,17 @@ export interface SystemMessage { export type Message = UserMessage | SystemMessage +function timeOfDay() { + const now = new Date() + const hours = now.getHours() + if (hours >= 6 && hours <= 9) { + return "evening" + } else if (hours > 9 || hours <= 4) { + return "night" + } + return "day" +} + export const INITLAL_MESSAGES: Message[] = [ { role: "user", @@ -35,6 +46,13 @@ export function waitListJoinedMessage(email: string): SystemMessage { message: `Thanks for joining the waitlist! I've sent you a confirmation email. I'll send an email to **${email}** when I'm ready. -Have a good day!`, +Have a good ${timeOfDay()}!`, + } +} + +export function duplicateEmailMessage(): SystemMessage { + return { + role: "system", + message: `I appreciate your excitement! You are already on the waitlist. When I am ready, I will reach out again. Have a good ${timeOfDay()} :)`, } }