@@ -6,7 +6,8 @@ import Parser from 'html-react-parser'
6
6
import CmtForm from "@/components/CmtForm" ;
7
7
import { getRelativeTime } from "@/utils/getRelativeTime" ;
8
8
import { GoTrash } from "react-icons/go" ;
9
- import { IPost , IComment } from "@/types" ;
9
+ // import { IPost, IComment } from "@/types";
10
+ import { IComment } from "@/types" ;
10
11
import LikeButton from "@/components/LikeButton" ;
11
12
// import svLike from "@/services/svLike";
12
13
import { useEffect , useState } from "react" ;
@@ -18,6 +19,7 @@ type Props = {
18
19
} ;
19
20
export default function Post ( { params } : Props ) {
20
21
const id : string = params . id ;
22
+ /* eslint-enable @typescript-eslint/no-unused-vars */
21
23
const { post, isLoadingInfo} = usePost ( id )
22
24
const { Comments, isLoadingComments} = useComments ( id )
23
25
const { Likes, isLoadingLikes} = useLikes ( id )
@@ -29,6 +31,8 @@ export default function Post({ params }: Props) {
29
31
token = localStorage . getItem ( 'jwt' )
30
32
await delPost ( id , token ) ;
31
33
}
34
+ const Cmts : IComment [ ] = Comments as IComment [ ]
35
+ // console.log(post)
32
36
return (
33
37
< >
34
38
< div className = "w-full p-8 flex flex-col justify-center items-center space-y-2" >
@@ -51,7 +55,8 @@ export default function Post({ params }: Props) {
51
55
</ div >
52
56
< div className = "border-2 border-slate-950 p-2 text-black rounded shadow h-full w-1/2 space-y-5" >
53
57
< a className = "font-bold text-2xl" > Bình Loạn</ a >
54
- { Comments ?. map ( ( element : IComment ) => (
58
+ { /* {
59
+ Cmts?.map((element: IComment) => (
55
60
<Comment
56
61
key={element.id}
57
62
id = {element.id}
@@ -61,7 +66,7 @@ export default function Post({ params }: Props) {
61
66
updated_at= {element.updated_at}
62
67
post_id= {element.post_id}
63
68
/>
64
- ) ) }
69
+ ))} */ }
65
70
</ div >
66
71
</ div >
67
72
</ >
0 commit comments