feat(db): mesh data model — meshes, members, invites, audit log
- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
25
packages/shared/src/utils/greeting.ts
Normal file
25
packages/shared/src/utils/greeting.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export type GreetingKey = "morning" | "afternoon" | "evening" | "night";
|
||||
|
||||
interface Greeting {
|
||||
text: GreetingKey;
|
||||
emoji: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a time-appropriate greeting key with matching emoji
|
||||
* The text property is an i18n key to be used with t("greeting.{key}")
|
||||
*/
|
||||
export function getGreeting(): Greeting {
|
||||
const hour = new Date().getHours();
|
||||
|
||||
if (hour >= 5 && hour < 12) {
|
||||
return { text: "morning", emoji: "🌅" };
|
||||
}
|
||||
if (hour >= 12 && hour < 17) {
|
||||
return { text: "afternoon", emoji: "☀️" };
|
||||
}
|
||||
if (hour >= 17 && hour < 21) {
|
||||
return { text: "evening", emoji: "🌆" };
|
||||
}
|
||||
return { text: "night", emoji: "🌙" };
|
||||
}
|
||||
Reference in New Issue
Block a user