import { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../context/AuthContext'; import { getDownloadInfo } from '../api/download'; import './DownloadSection.css'; export default function DownloadSection() { const [info, setInfo] = useState(null); const { user } = useAuth(); const navigate = useNavigate(); useEffect(() => { getDownloadInfo().then(setInfo); }, []); const handleDownload = (e) => { if (!user) { e.preventDefault(); navigate('/login'); } }; if (!info) return null; return (

게임 런처 다운로드

{info.fileName} · {info.fileSize} · {info.version}

{user ? '다운로드' : '로그인 후 다운로드'}
); }