- {epigram.tags.map((tag) => (
-
- #{tag.name}
-
- ))}
+
+
+ {epigram.tags.map((tag) => (
+
+ #{tag.name}
+
+ ))}
+
+ {isAuthor &&
}
{epigram.content}
diff --git a/src/pages/epigram/[id].tsx b/src/pages/epigram/[id].tsx
index bb517614..c947b12b 100644
--- a/src/pages/epigram/[id].tsx
+++ b/src/pages/epigram/[id].tsx
@@ -4,6 +4,7 @@ import CommentSection from '@/pageLayout/Epigram/EpigramComment';
import EpigramFigure from '@/pageLayout/Epigram/EpigramFigure';
import Image from 'next/image';
import { useRouter } from 'next/router';
+import { useMeQuery } from '@/hooks/userQueryHooks';
function DetailPage() {
const router = useRouter();
@@ -12,6 +13,7 @@ function DetailPage() {
const parsedId = GetEpigramRequestSchema.safeParse({ id });
const { data: epigram, isLoading, error } = useEpigramQuery(parsedId.success ? parsedId.data : undefined, parsedId.success);
+ const { data: userData } = useMeQuery();
if (isLoading) return 로딩 중...
;
if (!parsedId.success) return 잘못된 Epigram ID입니다.
;
@@ -25,8 +27,7 @@ function DetailPage() {
-
-
+
);
}
diff --git a/src/types/epigram.types.ts b/src/types/epigram.types.ts
new file mode 100644
index 00000000..4c6939b1
--- /dev/null
+++ b/src/types/epigram.types.ts
@@ -0,0 +1,7 @@
+import { GetEpigramResponseType } from '@/schema/epigram';
+import { GetUserResponseType } from '@/schema/user';
+
+export interface EpigramFigureProps {
+ epigram: GetEpigramResponseType;
+ currentUserId: GetUserResponseType['id'] | undefined;
+}