1
- import React from 'react'
2
- import styles from './admincommentssection.module.css'
1
+ import React from "react" ;
2
+ import styles from "./admincommentssection.module.css" ;
3
+ import BASE_PATH from "../../../base" ;
3
4
4
5
const comments = [
5
6
{
6
- image : ' /food.png' ,
7
- text : ' This is an insightful post!' ,
8
- name : ' John Doe' ,
9
-
7
+ image : " /food.png" ,
8
+ text : " This is an insightful post!" ,
9
+ name : " John Doe" ,
10
+
10
11
timestamp : 1697364830000 , // Unix timestamp
11
- postTitle : ' Understanding React Hooks'
12
+ postTitle : " Understanding React Hooks" ,
12
13
} ,
13
14
{
14
- image : ' /fashion.png' ,
15
- text : ' Thanks for the detailed explanation.' ,
16
- name : ' Jane Smith' ,
17
-
15
+ image : " /fashion.png" ,
16
+ text : " Thanks for the detailed explanation." ,
17
+ name : " Jane Smith" ,
18
+
18
19
timestamp : 1697288400000 ,
19
- postTitle : ' Advanced JavaScript Tips'
20
+ postTitle : " Advanced JavaScript Tips" ,
20
21
} ,
21
22
{
22
- image : ' /travel.png' ,
23
- text : ' Great read! I learned a lot.' ,
24
- name : ' Alice Johnson' ,
25
-
23
+ image : " /travel.png" ,
24
+ text : " Great read! I learned a lot." ,
25
+ name : " Alice Johnson" ,
26
+
26
27
timestamp : 1697378430000 ,
27
- postTitle : ' CSS Flexbox Guide'
28
+ postTitle : " CSS Flexbox Guide" ,
28
29
} ,
29
30
{
30
- image : ' /coding.png' ,
31
- text : ' Could you elaborate on the use of context in React?' ,
32
- name : ' Bob Brown' ,
33
-
31
+ image : " /coding.png" ,
32
+ text : " Could you elaborate on the use of context in React?" ,
33
+ name : " Bob Brown" ,
34
+
34
35
timestamp : 1697302030000 ,
35
- postTitle : ' Understanding React Context API'
36
+ postTitle : " Understanding React Context API" ,
36
37
} ,
37
38
{
38
- image : ' /style.png' ,
39
- text : ' This was exactly what I needed, thank you!' ,
40
- name : ' Charlie Davis' ,
41
-
39
+ image : " /style.png" ,
40
+ text : " This was exactly what I needed, thank you!" ,
41
+ name : " Charlie Davis" ,
42
+
42
43
timestamp : 1697315630000 ,
43
- postTitle : ' JavaScript ES6 Features'
44
+ postTitle : " JavaScript ES6 Features" ,
44
45
} ,
45
46
{
46
- image : ' /travel.png' ,
47
- text : ' I disagree with some points, but interesting perspective!' ,
48
- name : ' Eve Adams' ,
49
-
47
+ image : " /travel.png" ,
48
+ text : " I disagree with some points, but interesting perspective!" ,
49
+ name : " Eve Adams" ,
50
+
50
51
timestamp : 1697359230000 ,
51
- postTitle : ' Debunking Common JavaScript Myths'
52
+ postTitle : " Debunking Common JavaScript Myths" ,
52
53
} ,
53
54
{
54
- image : ' /coding.png' ,
55
- text : ' Fantastic tips for beginners!' ,
56
- name : ' George Harris' ,
57
-
55
+ image : " /coding.png" ,
56
+ text : " Fantastic tips for beginners!" ,
57
+ name : " George Harris" ,
58
+
58
59
timestamp : 1697345630000 ,
59
- postTitle : ' Getting Started with Node.js'
60
+ postTitle : " Getting Started with Node.js" ,
60
61
} ,
61
62
{
62
- image : ' /fashion.png' ,
63
- text : ' Your writing style is very engaging!' ,
64
- name : ' Hannah King' ,
65
-
63
+ image : " /fashion.png" ,
64
+ text : " Your writing style is very engaging!" ,
65
+ name : " Hannah King" ,
66
+
66
67
timestamp : 1697322030000 ,
67
- postTitle : ' Building Accessible Web Apps'
68
+ postTitle : " Building Accessible Web Apps" ,
68
69
} ,
69
70
{
70
- image : ' /style.png' ,
71
- text : ' I can’t wait to try these techniques out.' ,
72
- name : ' Ian Thompson' ,
73
-
71
+ image : " /style.png" ,
72
+ text : " I can’t wait to try these techniques out." ,
73
+ name : " Ian Thompson" ,
74
+
74
75
timestamp : 1697338430000 ,
75
- postTitle : ' Mastering CSS Grid'
76
+ postTitle : " Mastering CSS Grid" ,
76
77
} ,
77
78
{
78
- image : ' /culture.png' ,
79
- text : ' Please share more examples in the future!' ,
80
- name : ' Jessica White' ,
81
-
79
+ image : " /culture.png" ,
80
+ text : " Please share more examples in the future!" ,
81
+ name : " Jessica White" ,
82
+
82
83
timestamp : 1697382030000 ,
83
- postTitle : ' Intro to TypeScript'
84
- }
84
+ postTitle : " Intro to TypeScript" ,
85
+ } ,
85
86
] ;
86
87
87
-
88
-
89
-
90
88
const AdminCommentsSection = ( ) => {
91
89
return (
92
90
< div className = { styles . container } >
@@ -105,7 +103,13 @@ const AdminCommentsSection = () => {
105
103
< tbody >
106
104
{ comments . map ( ( comment , index ) => (
107
105
< tr key = { index } >
108
- < td > < img src = { comment . image } alt = "Commenter" className = { styles . commentImage } /> </ td >
106
+ < td >
107
+ < img
108
+ src = { `${ BASE_PATH } ${ comment . image } ` }
109
+ alt = "Commenter"
110
+ className = { styles . commentImage }
111
+ />
112
+ </ td >
109
113
< td > { comment . text } </ td >
110
114
< td > { comment . name } </ td >
111
115
< td > { comment . email } </ td >
@@ -119,5 +123,4 @@ const AdminCommentsSection = () => {
119
123
) ;
120
124
} ;
121
125
122
-
123
- export default AdminCommentsSection
126
+ export default AdminCommentsSection ;
0 commit comments