Skip to content

Commit e3afdb5

Browse files
authored
Merge pull request #91 from Nexters/feat/#85
Feat/#85
2 parents cc6b728 + b67ff71 commit e3afdb5

File tree

2 files changed

+47
-25
lines changed

2 files changed

+47
-25
lines changed
Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
"use client";
1+
import { Metadata } from "next";
22

3-
import TarotInteraction from "../../../../../tarot/components/TarotInteraction";
4-
import { useState } from "react";
3+
import TarotReadingResultClient from "@/tarot/components/TarotReadingResultClient";
4+
export const generateMetadata = (): Metadata => {
5+
return {
6+
title: "타로냥 - AI 타로로 보는 오늘의 운세, 무료 타로 상담",
7+
description: "고양이 타로술사 타로냥이 당신의 질문에 답해주는 AI 타로 서비스입니다.",
8+
openGraph: {
9+
title: "타로냥 - AI 타로로 보는 오늘의 운세, 무료 타로 상담",
10+
description: "고양이 타로술사 타로냥이 당신의 질문에 답해주는 AI 타로 서비스입니다.",
11+
images: [
12+
{
13+
url: "/opengraph-image.jpg",
14+
width: 1200,
15+
height: 630,
16+
alt: "Tarot Reading Result",
17+
},
18+
],
19+
},
20+
};
21+
};
522

6-
import TarotResultAfterView from "@/tarot/components/TarotResultAfterView";
7-
8-
import { useTarotReadingResult } from "@/tarot/hooks/useTarotReadingResult";
9-
import { useParams } from "next/navigation";
10-
import TarotResultHeader from "@/tarot/components/TarotResultHeader";
11-
12-
export default function TarotReadingResultPage() {
13-
const { resultId } = useParams();
14-
const [tarotInteraction, setTarotInteraction] = useState(true);
15-
const { data, isLoading } = useTarotReadingResult(Number(resultId));
16-
17-
return (
18-
<>
19-
{!tarotInteraction && <TarotResultHeader />}
20-
21-
{tarotInteraction || isLoading ? (
22-
<TarotInteraction setTarotInteraction={setTarotInteraction} tarotId={data?.tarot} />
23-
) : (
24-
<TarotResultAfterView />
25-
)}
26-
</>
27-
);
23+
export default function TarotReadingResultPage({ params }: { params: { resultId: string } }) {
24+
return <TarotReadingResultClient resultId={params.resultId} />;
2825
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use client";
2+
3+
import { useState } from "react";
4+
5+
import TarotInteraction from "./TarotInteraction";
6+
import TarotResultAfterView from "@/tarot/components/TarotResultAfterView";
7+
import TarotResultHeader from "@/tarot/components/TarotResultHeader";
8+
import { useTarotReadingResult } from "@/tarot/hooks/useTarotReadingResult";
9+
10+
export default function TarotReadingResultClient({ resultId }: { resultId: string }) {
11+
const [tarotInteraction, setTarotInteraction] = useState(true);
12+
const { data, isLoading } = useTarotReadingResult(Number(resultId));
13+
14+
return (
15+
<>
16+
{!tarotInteraction && <TarotResultHeader />}
17+
18+
{tarotInteraction || isLoading ? (
19+
<TarotInteraction setTarotInteraction={setTarotInteraction} tarotId={data?.tarot} />
20+
) : (
21+
<TarotResultAfterView />
22+
)}
23+
</>
24+
);
25+
}

0 commit comments

Comments
 (0)