|
1 | | -// import Image from "next/image" |
2 | | -// import Link from "next/link" |
3 | | -// import Tags from "@/components/Tags" |
4 | | -// import { format } from 'date-fns'; |
5 | | -// import { MdOutlineArrowOutward } from "react-icons/md"; |
6 | | - |
7 | | -// interface User { |
8 | | -// firstName: string; |
9 | | -// lastName: string; |
10 | | -// } |
11 | | - |
12 | | -// interface Tag { |
13 | | -// id: string; |
14 | | -// name: string; |
15 | | -// } |
16 | | - |
17 | | -// interface BlogTag { |
18 | | -// id: string; |
19 | | -// tagId: string; |
20 | | -// blogId: string; |
21 | | -// tag: Tag; // Add the nested tag structure |
22 | | -// } |
23 | | - |
24 | | -// interface Blog { |
25 | | -// id: string; |
26 | | -// blogName: string; |
27 | | -// hook: string; |
28 | | -// blogCover: string; |
29 | | -// blogCoverPublicId?: string | null; |
30 | | -// desc: string; |
31 | | -// status: boolean; |
32 | | -// createdAt: Date; |
33 | | -// updatedAt?: Date; |
34 | | -// userId: string; |
35 | | -// user: User; |
36 | | -// blogTags: BlogTag[]; |
37 | | -// } |
38 | | - |
39 | | -// const SingleCard = ({blog}:{blog:Blog}) => { |
40 | | - |
41 | | -// return ( |
42 | | -// <Link href={`/blog/${20}`}> |
43 | | -// <div className="w-full mb-4"> |
44 | | -// <Image src={`${blog?.blogCover}`} className="w-full h-full object-cover" width={800} height={300} alt="blog 1"/> |
45 | | -// </div> |
46 | | -// <div> |
47 | | -// <p className="para text-xs">{blog?.user?.firstName} {blog?.user?.lastName}+{format(new Date(blog?.createdAt), 'dd MMM yyyy')}</p> |
48 | | -// <div className="flex justify-between my-2"> |
49 | | -// <h1 className="truncate text-xl font-bold w-4/5" title={`${blog?.blogName}`}>{blog?.blogName}</h1> |
50 | | -// <span className="text-2xl font-extrabold"><MdOutlineArrowOutward /></span> |
51 | | -// </div> |
52 | | -// <p className="text-xs cardPara mb-4">{blog?.hook}</p> |
53 | | -// <Tags tags={blog.blogTags} /> |
54 | | - |
55 | | -// </div> |
56 | | -// </Link> |
57 | | -// ) |
58 | | -// } |
59 | | - |
60 | | -// export default SingleCard |
61 | | - |
62 | | - |
63 | | -import Image from "next/image"; |
64 | 1 | import Link from "next/link"; |
65 | 2 | import Tags from "@/components/Tags"; |
66 | 3 | import { format, isValid } from "date-fns"; |
@@ -89,9 +26,9 @@ const SingleCard = ({ blog }: { blog: Blog }) => { |
89 | 26 | return ( |
90 | 27 | <Link href={`/blog/${blog?.id}`} className="w-full grid grid-cols-6 gap-2 h-auto max-w-full"> |
91 | 28 | <div className="w-full overflow-hidden col-span-6"> |
92 | | - <Image |
| 29 | + <img |
93 | 30 | src={imageSrc} |
94 | | - className="w-full h-full object-cover" |
| 31 | + className="w-full h-full object-cover max-h-96" |
95 | 32 | width={800} |
96 | 33 | height={300} |
97 | 34 | alt={`${blog?.blogName}`} |
|
0 commit comments