Compare commits

...

2 Commits

Author SHA1 Message Date
a366281db8 Merge pull request 'Enhance dashboard greeting with user-specific welcome message' (#73) from feat/booking-panel into master
Reviewed-on: http://35.207.46.142/ATTUNE-HEART-THERAPY/website/pulls/73
2025-12-06 01:24:09 +00:00
iamkiddy
b103e97b42 Enhance dashboard greeting with user-specific welcome message
- Integrated user authentication to display a personalized welcome message on the admin dashboard, replacing the static greeting with the user's first name.
- Improved user experience by making the dashboard more engaging and tailored to individual users.
2025-12-06 01:23:04 +00:00

View File

@ -25,6 +25,7 @@ import {
import { useAppTheme } from "@/components/ThemeProvider";
import { getAllUsers } from "@/lib/actions/auth";
import { getAppointmentStats, listAppointments } from "@/lib/actions/appointments";
import { useAuth } from "@/hooks/useAuth";
import { toast } from "sonner";
import type { User } from "@/lib/models/auth";
import type { Appointment } from "@/lib/models/appointments";
@ -62,6 +63,7 @@ export default function Dashboard() {
const [loading, setLoading] = useState(true);
const [timePeriod, setTimePeriod] = useState<string>("last_month");
const { theme } = useAppTheme();
const { user } = useAuth();
const isDark = theme === "dark";
useEffect(() => {
@ -254,7 +256,7 @@ export default function Dashboard() {
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6">
<div>
<h1 className={`text-2xl font-semibold mb-1 ${isDark ? "text-white" : "text-gray-900"}`}>
Welcome Back! Hammond
Welcome Back! {user?.first_name || ""}
</h1>
<p className={`text-sm ${isDark ? "text-gray-400" : "text-gray-500"}`}>
Here's an overview of your practice today