Skip to content

Commit

Permalink
fix: 🐛 addressing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Loonz806 committed Jun 26, 2024
1 parent 8ea0617 commit 848ce9d
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/components/PostsList/PostsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ import Link from "next/link";
import styles from "./PostList.module.scss";

const PostsLists = ({ posts }) => {
const renderPosts = () => {
try {
return posts?.map((post) => {
const { title, author, date, content, id } = post;
return (
<article className={styles.saleItem} key={id}>
<Link href={`/blog/${encodeURIComponent(post.id)}`}>
<h3>{title}</h3>
<small>
{author} | {date}
</small>
<hr />
<p>{content}</p>
</Link>
</article>
);
});
} catch (e) {
throw new Error(e, "new error");
}
};
return <div className={styles.postList}>{renderPosts()}</div>;
const renderPosts = () => {
try {
return posts?.map((post) => {
const { title, author, date, content, id } = post;
return (
<article className={styles.saleItem} key={id}>
<Link href={`/blog/${encodeURIComponent(post.id)}`}>
<h3>{title}</h3>
<small>
{author} | {date}
</small>
<hr />
<p>{content}</p>
</Link>
</article>
);
});
} catch (e) {
throw new Error(e, "new error");
}
};
return <div className={styles.postList}>{renderPosts()}</div>;
};

export default PostsLists;

0 comments on commit 848ce9d

Please sign in to comment.