feat: add strategy list page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bc484fcb07
commit
475a056bc8
90
frontend/src/app/strategy/page.tsx
Normal file
90
frontend/src/app/strategy/page.tsx
Normal file
@ -0,0 +1,90 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import Sidebar from '@/components/layout/Sidebar';
|
||||
import Header from '@/components/layout/Header';
|
||||
import { api } from '@/lib/api';
|
||||
|
||||
interface User {
|
||||
id: number;
|
||||
username: string;
|
||||
}
|
||||
|
||||
const strategies = [
|
||||
{
|
||||
id: 'multi-factor',
|
||||
name: '멀티 팩터',
|
||||
description: '밸류, 퀄리티, 모멘텀 팩터를 조합한 종합 전략',
|
||||
icon: '📊',
|
||||
},
|
||||
{
|
||||
id: 'quality',
|
||||
name: '슈퍼 퀄리티',
|
||||
description: 'F-Score 기반 우량주 선별 전략',
|
||||
icon: '⭐',
|
||||
},
|
||||
{
|
||||
id: 'value-momentum',
|
||||
name: '밸류 모멘텀',
|
||||
description: '가치주와 모멘텀을 결합한 전략',
|
||||
icon: '📈',
|
||||
},
|
||||
];
|
||||
|
||||
export default function StrategyListPage() {
|
||||
const router = useRouter();
|
||||
const [user, setUser] = useState<User | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const init = async () => {
|
||||
try {
|
||||
const userData = await api.getCurrentUser() as User;
|
||||
setUser(userData);
|
||||
} catch {
|
||||
router.push('/login');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
init();
|
||||
}, [router]);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center">
|
||||
<div className="text-gray-500">Loading...</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<div className="flex-1">
|
||||
<Header username={user?.username} />
|
||||
<main className="p-6">
|
||||
<h1 className="text-2xl font-bold text-gray-800 mb-6">퀀트 전략</h1>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{strategies.map((strategy) => (
|
||||
<Link
|
||||
key={strategy.id}
|
||||
href={`/strategy/${strategy.id}`}
|
||||
className="bg-white rounded-lg shadow p-6 hover:shadow-lg transition-shadow"
|
||||
>
|
||||
<div className="text-4xl mb-4">{strategy.icon}</div>
|
||||
<h2 className="text-lg font-semibold text-gray-800 mb-2">
|
||||
{strategy.name}
|
||||
</h2>
|
||||
<p className="text-sm text-gray-500">{strategy.description}</p>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user