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" ;
34
45const comments = [
56 {
6- image : ' /food.png' ,
7- text : ' This is an insightful post!' ,
8- name : ' John Doe' ,
9- email : ' john@example.com' ,
7+ image : " /food.png" ,
8+ text : " This is an insightful post!" ,
9+ name : " John Doe" ,
10+ email : " john@example.com" ,
1011 timestamp : 1697364830000 , // Unix timestamp
11- postTitle : ' Understanding React Hooks'
12+ postTitle : " Understanding React Hooks" ,
1213 } ,
1314 {
14- image : ' /fashion.png' ,
15- text : ' Thanks for the detailed explanation.' ,
16- name : ' Jane Smith' ,
17- email : ' jane@example.com' ,
15+ image : " /fashion.png" ,
16+ text : " Thanks for the detailed explanation." ,
17+ name : " Jane Smith" ,
18+ email : " jane@example.com" ,
1819 timestamp : 1697288400000 ,
19- postTitle : ' Advanced JavaScript Tips'
20+ postTitle : " Advanced JavaScript Tips" ,
2021 } ,
2122 {
22- image : ' /travel.png' ,
23- text : ' Great read! I learned a lot.' ,
24- name : ' Alice Johnson' ,
25- email : ' alice.j@example.com' ,
23+ image : " /travel.png" ,
24+ text : " Great read! I learned a lot." ,
25+ name : " Alice Johnson" ,
26+ email : " alice.j@example.com" ,
2627 timestamp : 1697378430000 ,
27- postTitle : ' CSS Flexbox Guide'
28+ postTitle : " CSS Flexbox Guide" ,
2829 } ,
2930 {
30- image : ' /coding.png' ,
31- text : ' Could you elaborate on the use of context in React?' ,
32- name : ' Bob Brown' ,
33- email : ' bob.brown@example.com' ,
31+ image : " /coding.png" ,
32+ text : " Could you elaborate on the use of context in React?" ,
33+ name : " Bob Brown" ,
34+ email : " bob.brown@example.com" ,
3435 timestamp : 1697302030000 ,
35- postTitle : ' Understanding React Context API'
36+ postTitle : " Understanding React Context API" ,
3637 } ,
3738 {
38- image : ' /style.png' ,
39- text : ' This was exactly what I needed, thank you!' ,
40- name : ' Charlie Davis' ,
41- email : ' charlie.d@example.com' ,
39+ image : " /style.png" ,
40+ text : " This was exactly what I needed, thank you!" ,
41+ name : " Charlie Davis" ,
42+ email : " charlie.d@example.com" ,
4243 timestamp : 1697315630000 ,
43- postTitle : ' JavaScript ES6 Features'
44+ postTitle : " JavaScript ES6 Features" ,
4445 } ,
4546 {
46- image : ' /travel.png' ,
47- text : ' I disagree with some points, but interesting perspective!' ,
48- name : ' Eve Adams' ,
49- email : ' eve.a@example.com' ,
47+ image : " /travel.png" ,
48+ text : " I disagree with some points, but interesting perspective!" ,
49+ name : " Eve Adams" ,
50+ email : " eve.a@example.com" ,
5051 timestamp : 1697359230000 ,
51- postTitle : ' Debunking Common JavaScript Myths'
52+ postTitle : " Debunking Common JavaScript Myths" ,
5253 } ,
5354 {
54- image : ' /coding.png' ,
55- text : ' Fantastic tips for beginners!' ,
56- name : ' George Harris' ,
57- email : ' george.h@example.com' ,
55+ image : " /coding.png" ,
56+ text : " Fantastic tips for beginners!" ,
57+ name : " George Harris" ,
58+ email : " george.h@example.com" ,
5859 timestamp : 1697345630000 ,
59- postTitle : ' Getting Started with Node.js'
60+ postTitle : " Getting Started with Node.js" ,
6061 } ,
6162 {
62- image : ' /fashion.png' ,
63- text : ' Your writing style is very engaging!' ,
64- name : ' Hannah King' ,
65- email : ' hannah.k@example.com' ,
63+ image : " /fashion.png" ,
64+ text : " Your writing style is very engaging!" ,
65+ name : " Hannah King" ,
66+ email : " hannah.k@example.com" ,
6667 timestamp : 1697322030000 ,
67- postTitle : ' Building Accessible Web Apps'
68+ postTitle : " Building Accessible Web Apps" ,
6869 } ,
6970 {
70- image : ' /style.png' ,
71- text : ' I can’t wait to try these techniques out.' ,
72- name : ' Ian Thompson' ,
73- email : ' ian.t@example.com' ,
71+ image : " /style.png" ,
72+ text : " I can’t wait to try these techniques out." ,
73+ name : " Ian Thompson" ,
74+ email : " ian.t@example.com" ,
7475 timestamp : 1697338430000 ,
75- postTitle : ' Mastering CSS Grid'
76+ postTitle : " Mastering CSS Grid" ,
7677 } ,
7778 {
78- image : ' /culture.png' ,
79- text : ' Please share more examples in the future!' ,
80- name : ' Jessica White' ,
81- email : ' jessica.w@example.com' ,
79+ image : " /culture.png" ,
80+ text : " Please share more examples in the future!" ,
81+ name : " Jessica White" ,
82+ email : " jessica.w@example.com" ,
8283 timestamp : 1697382030000 ,
83- postTitle : ' Intro to TypeScript'
84- }
84+ postTitle : " Intro to TypeScript" ,
85+ } ,
8586] ;
8687
87-
88-
89-
9088const AdminCommentsSection = ( ) => {
9189 return (
9290 < div className = { styles . container } >
@@ -105,7 +103,13 @@ const AdminCommentsSection = () => {
105103 < tbody >
106104 { comments . map ( ( comment , index ) => (
107105 < 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 >
109113 < td > { comment . text } </ td >
110114 < td > { comment . name } </ td >
111115 < td > { comment . email } </ td >
@@ -119,5 +123,4 @@ const AdminCommentsSection = () => {
119123 ) ;
120124} ;
121125
122-
123- export default AdminCommentsSection
126+ export default AdminCommentsSection ;
0 commit comments