import '../style.scss'; import { Metadata } from 'next'; import MarketNav from '../_components/MarketNav'; import Sparkline from '../_components/Sparkline'; import { fetchForeignCustody } from '@/lib/api/seibro'; import { codeLabel, formatAmountCompact } from '@/lib/utils/market'; import { NATION_LABEL, FOREIGN_SECN_TPCD_LABEL } from '@/types/seibro'; export const metadata: Metadata = { title: '외화 커스터디 — 개미투자', description: '국가별 외화증권 보관금액 추이 — 서학개미 자금 흐름 (USD, SEIBro 수집)' }; export default async function MarketForeignPage() { const res = await fetchForeignCustody({}); const nations = res.success ? (res.data?.nations ?? []) : []; return (

외화 커스터디

국가별 외화증권 보관금액 추이 · USD 기준 (SEIBro)
{!res.success ? (
외화 커스터디 데이터를 불러오지 못했습니다. 잠시 후 다시 시도해 주세요.
) : nations.length === 0 ? (
표시할 외화 커스터디 데이터가 없습니다.
) : (
{nations.map((series, index) => { const latest = series.points.length > 0 ? series.points[series.points.length - 1] : null; const secnLabel = series.secnTpcd ? codeLabel(series.secnTpcd, FOREIGN_SECN_TPCD_LABEL) : '전체 합산'; return (
{codeLabel(series.nationCd, NATION_LABEL)} {secnLabel}
{formatAmountCompact(latest?.custodyAmount, ' USD')} p.custodyAmount)} label={`${codeLabel(series.nationCd, NATION_LABEL)} 보관금액 추이`} />
{series.nationCd} {latest?.stdDt ?? '—'} 기준
); })}
)}
); }