feat(stock): 거래 데스크에 관심종목 탭 등재 + API 문서 갱신

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UHXzpsZQxKG9hQmNRfZjRS
This commit is contained in:
2026-07-03 02:03:46 +09:00
parent e8091a0391
commit 3656ee9a59
3 changed files with 17 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ import SwipeableView from '../../components/SwipeableView';
import {
formatNumber, formatPercent,
toNumeric, profitColorClass,
TAB_PORTFOLIO, TAB_REPORT, TAB_ADVISOR, TAB_HOLDINGS_INTEL,
TAB_PORTFOLIO, TAB_REPORT, TAB_ADVISOR, TAB_HOLDINGS_INTEL, TAB_WATCHLIST,
} from './stockUtils';
/* ── hooks ──────────────────────────────────────────────────────── */
@@ -17,12 +17,14 @@ import useAssetHistory from './hooks/useAssetHistory';
import useMarketContext from './hooks/useMarketContext';
import useReportData from './hooks/useReportData';
import useAdvisor from './hooks/useAdvisor';
import useWatchlist from './hooks/useWatchlist';
/* ── tab components ─────────────────────────────────────────────── */
import PortfolioTab from './components/PortfolioTab';
import ReportTab from './components/ReportTab';
import AdvisorTab from './components/AdvisorTab';
import HoldingsIntelTab from './components/HoldingsIntelTab';
import WatchlistTab from './components/WatchlistTab';
import SellHistoryDrawer from './components/SellHistoryDrawer';
/* ── component ───────────────────────────────────────────────────── */
@@ -31,8 +33,8 @@ const StockTrade = () => {
const [activeTab, setActiveTab] = React.useState(TAB_REPORT);
const isMobile = useIsMobile();
const TAB_ORDER = [TAB_PORTFOLIO, TAB_REPORT, TAB_ADVISOR, TAB_HOLDINGS_INTEL];
const tabLabels = ['포트폴리오', '리포트', '어드바이저', '보유종목 인텔'];
const TAB_ORDER = [TAB_PORTFOLIO, TAB_REPORT, TAB_ADVISOR, TAB_HOLDINGS_INTEL, TAB_WATCHLIST];
const tabLabels = ['포트폴리오', '리포트', '어드바이저', '보유종목 인텔', '관심종목'];
const tabIndex = TAB_ORDER.indexOf(activeTab);
const handleTabChange = useCallback((idx) => setActiveTab(TAB_ORDER[idx]), []); // eslint-disable-line react-hooks/exhaustive-deps
@@ -62,6 +64,7 @@ const StockTrade = () => {
totalAssets: pf.totalAssets,
marketCtx,
});
const wl = useWatchlist();
/* ── sell history filter derived ─────────────────────────────── */
const sellHistoryBrokers = useMemo(() => {
@@ -169,7 +172,9 @@ const StockTrade = () => {
? <ReportTab pf={pf} report={report} ai={ai} marketCtx={marketCtx} />
: tabId === TAB_ADVISOR
? <AdvisorTab pf={pf} advisor={advisor} />
: <HoldingsIntelTab />,
: tabId === TAB_HOLDINGS_INTEL
? <HoldingsIntelTab />
: <WatchlistTab wl={wl} />,
}))}
activeIndex={tabIndex}
onTabChange={handleTabChange}
@@ -182,6 +187,7 @@ const StockTrade = () => {
{ id: TAB_REPORT, icon: '📊', label: '리포트', sub: '분석·AI코치' },
{ id: TAB_ADVISOR, icon: '🧠', label: 'AI 어드바이저', sub: 'Gemini Pro', className: 'stock-main-tab--advisor' },
{ id: TAB_HOLDINGS_INTEL, icon: '🔍', label: '보유종목 인텔', sub: '신호·이슈', className: 'stock-main-tab--holdings-intel' },
{ id: TAB_WATCHLIST, icon: '⭐', label: '관심종목', sub: '관리·시그널', badge: wl.items.length || null },
].map(({ id, icon, label, sub, badge, className: cls }) => (
<button
key={id}
@@ -203,6 +209,7 @@ const StockTrade = () => {
{activeTab === TAB_REPORT && <ReportTab pf={pf} report={report} ai={ai} marketCtx={marketCtx} />}
{activeTab === TAB_ADVISOR && <AdvisorTab pf={pf} advisor={advisor} />}
{activeTab === TAB_HOLDINGS_INTEL && <HoldingsIntelTab />}
{activeTab === TAB_WATCHLIST && <WatchlistTab wl={wl} />}
</>
)}

View File

@@ -150,3 +150,4 @@ export const TAB_PORTFOLIO = 'portfolio';
export const TAB_REPORT = 'report';
export const TAB_ADVISOR = 'advisor';
export const TAB_HOLDINGS_INTEL = 'holdings_intel';
export const TAB_WATCHLIST = 'watchlist';