From 01dcf9abe59f111ea5cea6b1d78864b4a2d4606d Mon Sep 17 00:00:00 2001 From: iamkiddy Date: Wed, 3 Dec 2025 11:03:01 +0000 Subject: [PATCH] Refactor appointment handling to streamline selected time slots and improve data payload structure. Update UI components to display selected slots clearly and enhance user experience by ensuring only relevant data is sent to the API. Remove legacy fields from appointment responses for cleaner data management. --- app/(admin)/_components/header.tsx | 90 +-------- app/(admin)/admin/booking/[id]/page.tsx | 207 ++++++++++++++++----- app/(pages)/book-now/page.tsx | 158 +++++++++++----- app/(user)/user/appointments/[id]/page.tsx | 205 +++++++++++++++----- lib/actions/appointments.ts | 98 +++++++--- 5 files changed, 508 insertions(+), 250 deletions(-) diff --git a/app/(admin)/_components/header.tsx b/app/(admin)/_components/header.tsx index 0073cd9..3c394fb 100644 --- a/app/(admin)/_components/header.tsx +++ b/app/(admin)/_components/header.tsx @@ -6,12 +6,10 @@ import { usePathname, useRouter } from "next/navigation"; import { Button } from "@/components/ui/button"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { - Inbox, Calendar, LayoutGrid, Heart, UserCog, - Bell, Settings, LogOut, FileText, @@ -24,7 +22,8 @@ import { toast } from "sonner"; export function Header() { const pathname = usePathname(); const router = useRouter(); - const [notificationsOpen, setNotificationsOpen] = useState(false); + // Notification state - commented out + // const [notificationsOpen, setNotificationsOpen] = useState(false); const [userMenuOpen, setUserMenuOpen] = useState(false); const { theme } = useAppTheme(); const isDark = theme === "dark"; @@ -37,7 +36,8 @@ export function Header() { router.push("/"); }; - // Mock notifications data + // Mock notifications data - commented out + /* const notifications = [ { id: 1, @@ -58,6 +58,7 @@ export function Header() { ]; const unreadCount = notifications.filter((n) => !n.read).length; + */ return (
@@ -105,86 +106,7 @@ export function Header() { {/* Right Side Actions */}
- - - - - - {/* Thumbtack Design at Top Right */} -
-
-
-
-
-

Notifications

- {unreadCount > 0 && ( - - {unreadCount} new - - )} -
-
- {notifications.length === 0 ? ( -
- -

No notifications

-
- ) : ( -
- {notifications.map((notification) => { - return ( -
-
-
-

- {notification.title} -

- {!notification.read && ( - - )} -
-

- {notification.message} -

-

- {notification.time} -

-
-
- ); - })} -
- )} -
-
- setNotificationsOpen(false)} - className={`block w-full text-center text-sm font-medium hover:underline transition-colors ${isDark ? "text-rose-300 hover:text-rose-200" : "text-rose-600 hover:text-rose-700"}`} - > - View all notifications - -
-
-
+ {/* Notification Popover - Commented out */}