1- import { Dispatch , SetStateAction , useState , useRef } from "react" ;
1+ import { Dispatch , SetStateAction , useState } from "react" ;
22import Image from "next/image" ;
33import Link from "next/link" ;
44import { Heart , MessageCircle , Bookmark , Ellipsis } from "lucide-react" ;
@@ -31,7 +31,6 @@ const BlogItem = ({ blog, handleDeletePopup, openBlogId, setOpenBlogId, isLastBl
3131 const { isBookmarked, isBookmarkLoading, handleBookmarkToggle } = useBookmarks ( ) ;
3232 const { following, isLoading, handleFollow, handleUnfollow } = useFollowStatus ( blog . authorId . _id ) ;
3333 const [ provider , setProvider ] = useState < TiptapCollabProvider | null > ( null ) ;
34- const tagColors = [ '#6941C6' , '#026AA2' , '#C11574' ] ;
3534
3635 const { previewText, timePublished } = handleBlogContentPreview ( {
3736 blogContent : blog . content ,
@@ -67,6 +66,7 @@ const BlogItem = ({ blog, handleDeletePopup, openBlogId, setOpenBlogId, isLastBl
6766 < p className = "text-xs text-black hover:underline" > { blog . authorId . name } </ p >
6867 </ Link >
6968 </ div >
69+
7070 { /* Blog content preview */ }
7171 < Link href = { `/${ blog . authorId . username } /${ blog . blogId } ` } >
7272 < div className = "flex items-start justify-between" >
@@ -85,6 +85,7 @@ const BlogItem = ({ blog, handleDeletePopup, openBlogId, setOpenBlogId, isLastBl
8585 ) }
8686 </ div >
8787 </ Link >
88+
8889 { /* Blog metadata and actions */ }
8990 < div className = "flex items-center text-sm justify-between max-w-[65%]" >
9091 < Link href = { `/${ blog . authorId . username } /${ blog . blogId } ` } className = "w-full" >
@@ -105,18 +106,6 @@ const BlogItem = ({ blog, handleDeletePopup, openBlogId, setOpenBlogId, isLastBl
105106 </ div >
106107 </ Link >
107108 < div className = "flex items-center space-x-6" >
108- < div className = "hidden sm:flex items-center space-x-2" >
109- { /* TODO: add more tags support*/ }
110- { blog . tags . slice ( 0 , 1 ) . map ( ( tag , index ) => (
111- < p
112- key = { tag }
113- className = "text-[11px] opacity-90 border rounded-3xl px-2 py-[1px]"
114- style = { { color : tagColors [ index % tagColors . length ] , borderColor : tagColors [ index % tagColors . length ] } }
115- >
116- { tag }
117- </ p >
118- ) ) }
119- </ div >
120109 < button onClick = { ( ) => handleBookmarkToggle ( blog . _id ) } disabled = { isBookmarkLoading } >
121110 < Bookmark size = { 18 } strokeWidth = { 1 } fill = { isBookmarked [ blog . _id ] ? "black" : "none" } />
122111 </ button >
0 commit comments