Skip to content

Commit

Permalink
removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishDave1 committed Nov 24, 2024
1 parent 9a955c4 commit 6ea4def
Showing 1 changed file with 0 additions and 95 deletions.
95 changes: 0 additions & 95 deletions src/app/(dashboard)/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
// <div className='container py-12'>
// <h1 className='font-bold text-5xl mb-8'>Recent Chats</h1>
// {friendsWithLastMessage.length === 0 ? (
// <p className='text-sm text-zinc-500'>No Recent Chats</p>
// ) : (
// friendsWithLastMessage.map((friend) => (
// <div
// key={friend.id}
// className='relative bg-zinc-50 border-zinc-200 p-3 rounded-md my-4'
// >
// <div className='absolute right-4 inset-y-0 flex items-center space-x-4'>
// <ChevronRight className='w-7 h-7 text-zinc-400' />
// </div>

// <Link
// href={`/dashboard/chat/${chatHrefConstructor(
// session.user.id,
// friend.id
// )}`}
// className='relative sm:flex'
// >
// <div className='mb-4 flex-shrink-0 sm:mb-0 sm:mr-4'>
// <div className='relative h-6 w-6'>
// <Image
// referrerPolicy='no-referrer'
// className='rounded-full'
// alt={`${friend.name} profile picture`}
// src={friend.image}
// fill
// />
// </div>
// </div>

// <div>
// <h4 className='text-lg font-semibold'>{friend.name}</h4>
// <p className='mt-1 max-w-md'>
// <span className='text-zinc-400'>
// {friend.lastMessage.senderId === session.user.id
// ? "You: "
// : ""}
// </span>
// {friend.lastMessage.text}
// </p>
// </div>
// </Link>
// </div>
// ))
// )}
// </div>
// );
// };

// export default Dashboard;

/** @format */

import { signOut, useSession } from "next-auth/react";
Expand Down

0 comments on commit 6ea4def

Please sign in to comment.