/** * 서비스 진입 스플래시 — 글래스모피즘 로그인 */ import React, { useState } from 'react'; import { loginUser, type LoginResponse } from '../utils/backendApi'; import '../styles/splashScreen.css'; const DEFAULT_USERNAME = 'admin'; const DEFAULT_PASSWORD = 'admin'; const APP_VERSION = '1.0.3'; interface Props { onLoginSuccess: (res: LoginResponse) => void; onGuest: () => void; } const SplashScreen: React.FC = ({ onLoginSuccess, onGuest }) => { const [username, setUsername] = useState(DEFAULT_USERNAME); const [password, setPassword] = useState(DEFAULT_PASSWORD); const [error, setError] = useState(null); const [loading, setLoading] = useState(false); const submitLogin = async (e: React.FormEvent) => { e.preventDefault(); setError(null); setLoading(true); try { const res = await loginUser(username.trim(), password); onLoginSuccess(res); } catch (err) { setError(err instanceof Error ? err.message : '로그인에 실패했습니다.'); } finally { setLoading(false); } }; return (

GoldenChart

setUsername(e.target.value)} disabled={loading} placeholder="ID" /> setPassword(e.target.value)} disabled={loading} placeholder="••••••••" /> {error &&

{error}

}

버전: {APP_VERSION} | Core Engine: Ta4j & Spring Boot

); }; export default SplashScreen;