Skip to content
Snippets Groups Projects
post-item.tsx 1.31 KiB
Newer Older
Yusuf Akgül's avatar
Yusuf Akgül committed
import { formatTimeElapsed } from "@/lib/utils";
import { IPost } from "@/types/prisma-item";
// import CommentButton from "./post-comment-button";
// import LikeButton from "./post-like-button";
import { UserAvatar } from "./user-avatar";
Yusuf Akgül's avatar
Yusuf Akgül committed
export default function PostItem({ msg }: { msg: IPost }) {
Yusuf Akgül's avatar
Yusuf Akgül committed
        <div className="flex">
            <UserAvatar
                user={{ name: msg.user.username || null, image: msg.user.image || null }}
                className="h-10 w-10"
            />
            <div className="ml-4 flex flex-col flex-grow">
                <div>
                    <div className="flex items-center">
Yusuf Akgül's avatar
Yusuf Akgül committed
                        <h1 className="font-bold mr-2">{msg.user.name}</h1>
                        <h1 className="text-sky-500 text-sm">
                            @{msg.user.username}
                        </h1>
                        <h1 className="text-gray-500 text-sm ml-auto">
                            {formatTimeElapsed(msg.createdAt)}
                        </h1>
Yusuf Akgül's avatar
Yusuf Akgül committed
                    <h1>{msg.content}</h1>
Yusuf Akgül's avatar
Yusuf Akgül committed
                {/* <div className="flex justify-end" >
                    <LikeButton data={msg} />
                    <CommentButton data={msg} />
Yusuf Akgül's avatar
Yusuf Akgül committed
                </div> */}
Yusuf Akgül's avatar
Yusuf Akgül committed
}