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(5)}`}
alt={`http://localhost:8080/${el.replaceAll("\\", "/").substring(5)}`}
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>댓글: {comments.length} // 조와요: {likes.length}</p>
</div>
);
}
export default Article;