import React, { useState } from 'react'; import Layout from '@/components/Layout'; import { Settings, Save, RefreshCw, AlertCircle, CheckCircle } from 'lucide-react'; const SettingsPage: React.FC = () => { const [apiUrl, setApiUrl] = useState(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:18001/api/v1'); const [autoRefresh, setAutoRefresh] = useState(true); const [refreshInterval, setRefreshInterval] = useState(30); const [theme, setTheme] = useState('light'); const [notifications, setNotifications] = useState(true); const [savedMessage, setSavedMessage] = useState(''); const handleSave = () => { // 여기서 실제로는 localStorage나 서버에 설정을 저장 localStorage.setItem('stockOracleSettings', JSON.stringify({ apiUrl, autoRefresh, refreshInterval, theme, notifications, })); setSavedMessage('설정이 저장되었습니다.'); setTimeout(() => setSavedMessage(''), 3000); }; const handleReset = () => { setApiUrl('http://localhost:18001/api/v1'); setAutoRefresh(true); setRefreshInterval(30); setTheme('light'); setNotifications(true); }; return (
{/* 헤더 */}

시스템 설정

{/* 성공 메시지 */} {savedMessage && (

{savedMessage}

)} {/* API 설정 */}

API 설정

setApiUrl(e.target.value)} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="http://localhost:18001/api/v1" />

Stock Oracle API 서버의 주소를 입력하세요.

setAutoRefresh(e.target.checked)} className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" />
{autoRefresh && (
)}
{/* 사용자 인터페이스 설정 */}

사용자 인터페이스

setNotifications(e.target.checked)} className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" />
{/* 데이터 설정 */}

데이터 설정

데이터 새로고침 주의사항

강제 새로고침은 외부 API 호출을 발생시켜 응답 시간이 길어질 수 있습니다. 일반적으로 캐시된 데이터를 사용하는 것을 권장합니다.

실제 vs 추정 데이터

실제 데이터는 SEC EDGAR에서 가져온 정확한 재무 데이터입니다. 추정 데이터는 기존 시스템에서 생성된 임시 데이터입니다.

{/* 시스템 정보 */}

시스템 정보

버전

Stock Oracle v1.0.0

빌드 날짜

{new Date().toLocaleDateString('ko-KR')}

현재 API URL

{apiUrl}

브라우저 지원

Chrome, Firefox, Safari, Edge

{/* 액션 버튼 */}
); }; export default SettingsPage;