로딩 중...
;
if (error) return
최신 에피그램
- {data?.list.map((epigram) =>
)}
+ {data?.list.map((epigram: RecentEpigramType) => (
+
handleEpigramClick(epigram.id)}
+ role='button'
+ tabIndex={0}
+ onKeyPress={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ handleEpigramClick(epigram.id);
+ }
+ }}
+ >
+
+
+ ))}
+ {data && limit < data.totalCount &&
}
);
}
diff --git a/src/hooks/useGetRecentEpigrams.ts b/src/hooks/useGetRecentEpigrams.ts
index 6b2f26f9..beaaa314 100644
--- a/src/hooks/useGetRecentEpigrams.ts
+++ b/src/hooks/useGetRecentEpigrams.ts
@@ -2,10 +2,10 @@ import { useQuery } from '@tanstack/react-query';
import getRecentEpigrams from '@/apis/getRecentEpigrams';
import { GetRecentEpigramsResponseType } from '@/schema/recentEpigram';
-const useGetRecentEpigrams = () =>
+const useGetRecentEpigrams = (limit: number) =>
useQuery