Newer
Older
import React, { useEffect, useState } from "react";
import { Routes, Route, Link, useNavigate, Navigate } from 'react-router-dom';
import { useParams } from 'react-router-dom';
function Article({ data }) {
const {
_id, title, content, imageUrls, author,
// http://localhost:8080/uploads/21701487062905.png
src={`http://localhost:8080/${el.replaceAll("\\", "/").substring(7)}`}
alt={`http://localhost:8080/${el.replaceAll("\\", "/").substring(7)}`}
style={{ width: "100px", height: "100px" }} />
)
});
const date = DateTime.fromISO(createdAt).toFormat('yyyy-MM-dd HH:mm');
<div className="article" onClick={() => { console.log(_id); MoveTo(`/post/${_id}`) }}>
<p className="comments">댓글 {comments.length} | 좋아요 {likes.length}</p>
</div>
);
}
export default Article;