|
| 1 | +import { Link } from 'react-router-dom' |
| 2 | +import { |
| 3 | + ScoreTrend, |
| 4 | + StatsSummary, |
| 5 | + useUserStats, |
| 6 | +} from '@/features/history' |
| 7 | +import { Button } from '@/shared/ui/Button' |
| 8 | + |
| 9 | +export function HomeView() { |
| 10 | + const { data: stats } = useUserStats() |
| 11 | + const hasSessions = (stats?.totalSessionCount ?? 0) > 0 |
| 12 | + |
| 13 | + return ( |
| 14 | + <div className="space-y-8"> |
| 15 | + <section className="overflow-hidden rounded-2xl border border-border bg-sage-600 p-8 text-white"> |
| 16 | + <p className="text-caption uppercase tracking-[0.08em] text-white/60"> |
| 17 | + 맞춤 모의 면접 |
| 18 | + </p> |
| 19 | + <h2 className="mt-2 font-heading text-h4 font-bold"> |
| 20 | + 이력서·레포 기반 맞춤 면접을 시작하세요 |
| 21 | + </h2> |
| 22 | + <p className="mt-2 max-w-xl text-body text-white/70"> |
| 23 | + 면접 모드와 직군을 고르면 AI가 질문을 생성하고, 실시간으로 답변을 |
| 24 | + 주고받습니다. |
| 25 | + </p> |
| 26 | + <div className="mt-6 flex flex-wrap gap-3"> |
| 27 | + <Link to="/sessions/new"> |
| 28 | + <Button size="lg" variant="secondary"> |
| 29 | + 새 면접 시작 |
| 30 | + </Button> |
| 31 | + </Link> |
| 32 | + <Link to="/workspace/resumes"> |
| 33 | + <Button |
| 34 | + size="lg" |
| 35 | + variant="ghost" |
| 36 | + className="text-white hover:bg-white/10" |
| 37 | + > |
| 38 | + 자료 준비하기 |
| 39 | + </Button> |
| 40 | + </Link> |
| 41 | + </div> |
| 42 | + </section> |
| 43 | + |
| 44 | + <div className="grid gap-4 md:grid-cols-3"> |
| 45 | + <QuickLink |
| 46 | + to="/workspace/resumes" |
| 47 | + title="이력서" |
| 48 | + description="이력서를 업로드하고 분석 결과를 확인하세요." |
| 49 | + /> |
| 50 | + <QuickLink |
| 51 | + to="/workspace/repos" |
| 52 | + title="레포지토리" |
| 53 | + description="GitHub 레포를 등록하고 분석 결과를 확인하세요." |
| 54 | + /> |
| 55 | + <QuickLink |
| 56 | + to="/workspace/history" |
| 57 | + title="면접 히스토리" |
| 58 | + description="지난 면접 기록과 점수 추이를 확인하세요." |
| 59 | + /> |
| 60 | + </div> |
| 61 | + |
| 62 | + {hasSessions && stats && ( |
| 63 | + <section className="space-y-3"> |
| 64 | + <h2 className="text-h6 text-fg">한눈에 보기</h2> |
| 65 | + <div className="grid gap-4 md:grid-cols-2"> |
| 66 | + <StatsSummary stats={stats} /> |
| 67 | + <ScoreTrend stats={stats} /> |
| 68 | + </div> |
| 69 | + </section> |
| 70 | + )} |
| 71 | + </div> |
| 72 | + ) |
| 73 | +} |
| 74 | + |
| 75 | +function QuickLink({ |
| 76 | + to, |
| 77 | + title, |
| 78 | + description, |
| 79 | +}: { |
| 80 | + to: string |
| 81 | + title: string |
| 82 | + description: string |
| 83 | +}) { |
| 84 | + return ( |
| 85 | + <Link |
| 86 | + to={to} |
| 87 | + className="group flex items-center justify-between gap-4 rounded-xl border border-border bg-surface-raised p-5 transition-colors duration-fast hover:border-border-strong hover:bg-surface" |
| 88 | + > |
| 89 | + <div> |
| 90 | + <h3 className="font-heading text-h6 font-bold text-fg-strong"> |
| 91 | + {title} |
| 92 | + </h3> |
| 93 | + <p className="mt-1 text-caption text-fg-muted">{description}</p> |
| 94 | + </div> |
| 95 | + <span |
| 96 | + aria-hidden |
| 97 | + className="text-fg-muted transition-transform duration-fast group-hover:translate-x-0.5" |
| 98 | + > |
| 99 | + → |
| 100 | + </span> |
| 101 | + </Link> |
| 102 | + ) |
| 103 | +} |
0 commit comments