feat: complete onboarding flow

This commit is contained in:
Zoe
2026-10-08 14:04:29 -05:00
parent fae05ebc4c
commit 61f9bb74b4
16 changed files with 684 additions and 297 deletions
+15
View File
@@ -0,0 +1,15 @@
const HOUR_MS = 60 * 60 * 1000;
const DAY_MS = 24 * HOUR_MS;
/** How long until a date, in whole days or hours: "6 days", "3 hours". */
export const timeLeft = (until: string | Date): string => {
const ms = new Date(until).getTime() - Date.now();
if (ms >= DAY_MS) {
const days = Math.ceil(ms / DAY_MS);
return `${days} ${days === 1 ? 'day' : 'days'}`;
}
const hours = Math.max(1, Math.ceil(ms / HOUR_MS));
return `${hours} ${hours === 1 ? 'hour' : 'hours'}`;
};