Skip to content

Commit b70171b

Browse files
committed
feat(frontend): 면접 세션 페이지·라우트 연결
1 parent ee7c526 commit b70171b

5 files changed

Lines changed: 74 additions & 0 deletions

File tree

frontend/src/app/router/index.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import HomePage from '@/pages/Home'
44
import LoginPage from '@/pages/Login'
55
import AuthCallbackPage from '@/pages/AuthCallback'
66
import WorkspacePage from '@/pages/Workspace'
7+
import InterviewSetupPage from '@/pages/InterviewSetup'
8+
import InterviewSessionPage from '@/pages/InterviewSession'
9+
import SessionFeedbackPage from '@/pages/SessionFeedback'
710

811
export const router = createBrowserRouter([
912
{ path: '/', element: <HomePage /> },
@@ -17,6 +20,30 @@ export const router = createBrowserRouter([
1720
</RequireAuth>
1821
),
1922
},
23+
{
24+
path: '/sessions/new',
25+
element: (
26+
<RequireAuth>
27+
<InterviewSetupPage />
28+
</RequireAuth>
29+
),
30+
},
31+
{
32+
path: '/sessions/:id',
33+
element: (
34+
<RequireAuth>
35+
<InterviewSessionPage />
36+
</RequireAuth>
37+
),
38+
},
39+
{
40+
path: '/sessions/:id/feedback',
41+
element: (
42+
<RequireAuth>
43+
<SessionFeedbackPage />
44+
</RequireAuth>
45+
),
46+
},
2047
{
2148
path: '/design-system/*',
2249
lazy: async () => {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './ui/InterviewSessionPage'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useParams } from 'react-router-dom'
2+
import { LiveInterview } from '@/features/interview'
3+
4+
export default function InterviewSessionPage() {
5+
const { id } = useParams<{ id: string }>()
6+
const sessionId = Number(id)
7+
if (!Number.isFinite(sessionId) || sessionId <= 0) {
8+
return <div className="px-4 py-16 text-center text-fg-muted">잘못된 세션입니다.</div>
9+
}
10+
return (
11+
<div className="mx-auto flex h-screen max-w-content flex-col">
12+
<LiveInterview sessionId={sessionId} />
13+
</div>
14+
)
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './ui/InterviewSetupPage'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { useNavigate } from 'react-router-dom'
2+
import { useDocuments } from '@/features/analysis'
3+
import { InterviewSetupForm, useCreateSession } from '@/features/interview'
4+
import type { DocOption } from '@/features/interview'
5+
6+
export default function InterviewSetupPage() {
7+
const navigate = useNavigate()
8+
const { data: documents = [] } = useDocuments()
9+
const createSession = useCreateSession()
10+
11+
const options: DocOption[] = documents
12+
.filter((d) => d.analysisStatus === 'ANALYZED')
13+
.map((d) => ({
14+
id: d.id,
15+
label: d.summary?.slice(0, 40) ?? `${d.sourceType} #${d.sourceId}`,
16+
sourceType: d.sourceType,
17+
}))
18+
19+
return (
20+
<InterviewSetupForm
21+
documents={options}
22+
isSubmitting={createSession.isPending}
23+
onCreate={(req) =>
24+
createSession.mutate(req, {
25+
onSuccess: (session) => navigate(`/sessions/${session.id}`),
26+
})
27+
}
28+
/>
29+
)
30+
}

0 commit comments

Comments
 (0)