aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/components/ArticleItem.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-04 09:27:30 +0900
committernsfisis <nsfisis@gmail.com>2025-08-04 09:27:30 +0900
commit0f0a08196a045d49cf98bb2b841e6475cc0c94a6 (patch)
treec8d0353eca02ed6e5c97166c2683d033025fb1af /frontend/src/components/ArticleItem.tsx
parentfb52b25834b95ff9a11f8c7d3c20453e26d3bd4f (diff)
downloadfeedaka-0f0a08196a045d49cf98bb2b841e6475cc0c94a6.tar.gz
feedaka-0f0a08196a045d49cf98bb2b841e6475cc0c94a6.tar.zst
feedaka-0f0a08196a045d49cf98bb2b841e6475cc0c94a6.zip
refactor(frontend): Remove unnecessary component property
Diffstat (limited to 'frontend/src/components/ArticleItem.tsx')
-rw-r--r--frontend/src/components/ArticleItem.tsx35
1 files changed, 16 insertions, 19 deletions
diff --git a/frontend/src/components/ArticleItem.tsx b/frontend/src/components/ArticleItem.tsx
index 8fb00b0..faa86fe 100644
--- a/frontend/src/components/ArticleItem.tsx
+++ b/frontend/src/components/ArticleItem.tsx
@@ -18,10 +18,9 @@ type Article = NonNullable<
interface Props {
article: Article;
- showReadStatus?: boolean;
}
-export function ArticleItem({ article, showReadStatus = true }: Props) {
+export function ArticleItem({ article }: Props) {
const [, markArticleRead] = useMutation(MarkArticleReadDocument);
const [, markArticleUnread] = useMutation(MarkArticleUnreadDocument);
@@ -66,23 +65,21 @@ export function ArticleItem({ article, showReadStatus = true }: Props) {
: "border-blue-200 bg-blue-50"
}`}
>
- {showReadStatus && (
- <button
- type="button"
- onClick={() => handleToggleRead(article.id, optimisticArticle.isRead)}
- className={`flex-shrink-0 rounded p-1 transition-colors ${
- optimisticArticle.isRead
- ? "text-gray-400 hover:text-gray-600"
- : "text-blue-600 hover:text-blue-700"
- }`}
- title={optimisticArticle.isRead ? "Mark as unread" : "Mark as read"}
- >
- <FontAwesomeIcon
- icon={optimisticArticle.isRead ? faCheck : faCircle}
- className="w-4 h-4"
- />
- </button>
- )}
+ <button
+ type="button"
+ onClick={() => handleToggleRead(article.id, optimisticArticle.isRead)}
+ className={`flex-shrink-0 rounded p-1 transition-colors ${
+ optimisticArticle.isRead
+ ? "text-gray-400 hover:text-gray-600"
+ : "text-blue-600 hover:text-blue-700"
+ }`}
+ title={optimisticArticle.isRead ? "Mark as unread" : "Mark as read"}
+ >
+ <FontAwesomeIcon
+ icon={optimisticArticle.isRead ? faCheck : faCircle}
+ className="w-4 h-4"
+ />
+ </button>
<div className="flex-1 min-w-0">
<button
type="button"