feat: web UI chat render, panels, presence + analytics
This commit is contained in:
1 parent
75425d1bee
commit
ed469ba8dd
83 files changed
+6034
-136
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import type { PresenceSample } from "$lib/api/types";
|
||||
import { formatListDate } from "$lib/format/datetime";
|
||||
|
||||
export function formatPresence(sample: PresenceSample): string {
|
||||
switch (sample.status) {
|
||||
case "online":
|
||||
return "online";
|
||||
case "recently":
|
||||
return "last seen recently";
|
||||
case "last_week":
|
||||
return "last seen within a week";
|
||||
case "last_month":
|
||||
return "last seen within a month";
|
||||
case "long_time_ago":
|
||||
return "last seen a long time ago";
|
||||
default:
|
||||
return sample.last_online_date
|
||||
? `last seen ${formatListDate(sample.last_online_date)}`
|
||||
: "offline";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user