import { getAtk, readProfiles, useUserinfo } from "../stores/userinfo.tsx"; import { createSignal, For, Show } from "solid-js"; export default function DashboardPage() { const userinfo = useUserinfo(); const [error, setError] = createSignal(null); function getGreeting() { const currentHour = new Date().getHours(); if (currentHour >= 0 && currentHour < 12) { return "Good morning! Wishing you a day filled with joy and success. ☀️"; } else if (currentHour >= 12 && currentHour < 18) { return "Afternoon! Hope you have a productive and joyful afternoon! ☀️"; } else { return "Good evening! Wishing you a relaxing and pleasant evening. 🌙"; } } async function readNotification(item: any) { const res = await fetch(`/api/notifications/${item.id}/read`, { method: "PUT", headers: { Authorization: `Bearer ${getAtk()}` } }); if (res.status !== 200) { setError(await res.text()); } else { await readProfiles(); setError(null); } } return (

{userinfo?.displayName}

{getGreeting()}

Notifications

You're done! There are no notifications unread for you.
0}> {item => }

{item.subject}

{item.content}

{item => {item.label}}
); }