From 6ea4defeca8e705ec3613784061316b763e268fc Mon Sep 17 00:00:00 2001 From: KrishDave1 Date: Sun, 24 Nov 2024 18:18:33 +0530 Subject: [PATCH] removed comments --- src/app/(dashboard)/dashboard/page.tsx | 95 -------------------------- 1 file changed, 95 deletions(-) diff --git a/src/app/(dashboard)/dashboard/page.tsx b/src/app/(dashboard)/dashboard/page.tsx index 1431020..c9f1592 100644 --- a/src/app/(dashboard)/dashboard/page.tsx +++ b/src/app/(dashboard)/dashboard/page.tsx @@ -1,98 +1,3 @@ -// /** @format */ - -// import { signOut, useSession } from "next-auth/react"; -// import { Button } from "@/components/ui/Button"; -// import { getServerSession } from "next-auth"; -// import { authOptions } from "../../api/auth/[...nextauth]/options"; -// import { notFound } from "next/navigation"; -// import { getFriendsByUserId } from "@/helpers/get-friends-by-userId"; -// import { fetchRedis } from "@/helpers/redis"; -// import { chatHrefConstructor } from "@/lib/utils"; -// import { ChevronRight } from "lucide-react"; -// import Link from "next/link"; -// import Image from "next/image"; - -// const Dashboard = async () => { -// const session = await getServerSession(authOptions); - -// if (!session) { -// notFound(); -// } - -// const friends = await getFriendsByUserId(session.user.id); - -// const friendsWithLastMessage = await Promise.all( -// friends.map(async (friend) => { -// const [lastMessageRaw] = (await fetchRedis( -// "zrange", -// `chat:${chatHrefConstructor(session.user.id, friend.id)}:messages`, -// -1, -// -1 -// )) as string[]; - -// const lastMessage = JSON.parse(lastMessageRaw) as Message; -// return { -// ...friend, -// lastMessage, -// }; -// }) -// ); - -// return ( -//
-//

Recent Chats

-// {friendsWithLastMessage.length === 0 ? ( -//

No Recent Chats

-// ) : ( -// friendsWithLastMessage.map((friend) => ( -//
-//
-// -//
- -// -//
-//
-// {`${friend.name} -//
-//
- -//
-//

{friend.name}

-//

-// -// {friend.lastMessage.senderId === session.user.id -// ? "You: " -// : ""} -// -// {friend.lastMessage.text} -//

-//
-// -//
-// )) -// )} -//
-// ); -// }; - -// export default Dashboard; - /** @format */ import { signOut, useSession } from "next-auth/react";