bugfix
This commit is contained in:
@ -10,7 +10,7 @@ const LatestNews = async () => {
|
||||
pageSize: 1,
|
||||
sort: "new",
|
||||
});
|
||||
if (!lists.length) {
|
||||
if (!lists?.length) {
|
||||
return <></>;
|
||||
}
|
||||
const { id } = lists[0];
|
||||
@ -18,22 +18,21 @@ const LatestNews = async () => {
|
||||
id: `${id}`,
|
||||
});
|
||||
|
||||
// const text = window.document.createElement("div");
|
||||
// text.innerHTML = article.content;
|
||||
const content = htmlToText(article.content, {
|
||||
// baseElements:{
|
||||
// selectors:['p']
|
||||
// }
|
||||
selectors: [{ selector: "img", format: "skip" }],
|
||||
});
|
||||
// const content = text.innerText;
|
||||
|
||||
return (
|
||||
<div className={"h-[180px] bg-white p-2 flex"}>
|
||||
<Link
|
||||
href={`general-news/${lists[0].id}`}
|
||||
className={"article-cover w-[207px]"}
|
||||
>
|
||||
<Image src={article.image} alt={""} />
|
||||
<img
|
||||
className={"w-full h-full object-cover"}
|
||||
src={`${process.env.NEXT_PUBLIC_ADMIN_BASE_URL}/uploads/${article.image}`}
|
||||
alt={""}
|
||||
/>
|
||||
</Link>
|
||||
<div className={"w-0 flex-1 ml-1 relative"}>
|
||||
<Link
|
||||
|
Reference in New Issue
Block a user