|
@@ -5,8 +5,11 @@ import type { WorldIndexRow } from '@/types/worldIndex';
|
|
|
import type { MarketQuoteRow } from '@/types/marketQuote';
|
|
import type { MarketQuoteRow } from '@/types/marketQuote';
|
|
|
import { fetchWorldIndices } from '@/lib/api/worldIndices';
|
|
import { fetchWorldIndices } from '@/lib/api/worldIndices';
|
|
|
import { fetchMarketQuotes } from '@/lib/api/marketQuotes';
|
|
import { fetchMarketQuotes } from '@/lib/api/marketQuotes';
|
|
|
|
|
+import type { DomesticIndexRow } from '@/types/domesticSummary';
|
|
|
|
|
+import { fetchDomesticSummary } from '@/lib/api/domesticSummary';
|
|
|
import HomeBannerCarousel from './_components/HomeBannerCarousel';
|
|
import HomeBannerCarousel from './_components/HomeBannerCarousel';
|
|
|
import WorldMarketMap from './_components/WorldMarketMap';
|
|
import WorldMarketMap from './_components/WorldMarketMap';
|
|
|
|
|
+import DomesticSummary from './_components/DomesticSummary';
|
|
|
import MajorQuotesGrid from './_components/MajorQuotesGrid';
|
|
import MajorQuotesGrid from './_components/MajorQuotesGrid';
|
|
|
import LiveChannelGrid from './_components/LiveChannelGrid';
|
|
import LiveChannelGrid from './_components/LiveChannelGrid';
|
|
|
import LiveChannelEmpty from './_components/LiveChannelEmpty';
|
|
import LiveChannelEmpty from './_components/LiveChannelEmpty';
|
|
@@ -61,13 +64,24 @@ async function loadMarketQuotes(): Promise<MarketQuoteRow[]> {
|
|
|
return res.data.list;
|
|
return res.data.list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+async function loadDomesticSummary(): Promise<DomesticIndexRow[]> {
|
|
|
|
|
+ const res = await fetchDomesticSummary();
|
|
|
|
|
+
|
|
|
|
|
+ if (!res.success || !res.data) {
|
|
|
|
|
+ return [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return res.data.list;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export default async function Home() {
|
|
export default async function Home() {
|
|
|
// 채널 기능 OFF: 라이브 채널 섹션 미노출이므로 조회 생략
|
|
// 채널 기능 OFF: 라이브 채널 섹션 미노출이므로 조회 생략
|
|
|
- const [banners, live, worldIndices, marketQuotes] = await Promise.all([
|
|
|
|
|
|
|
+ const [banners, live, worldIndices, marketQuotes, domesticSummary] = await Promise.all([
|
|
|
loadActiveBanners(),
|
|
loadActiveBanners(),
|
|
|
FEATURE_CHANNEL ? loadLiveChannels() : Promise.resolve({ channels: [], total: 0 }),
|
|
FEATURE_CHANNEL ? loadLiveChannels() : Promise.resolve({ channels: [], total: 0 }),
|
|
|
loadWorldIndices(),
|
|
loadWorldIndices(),
|
|
|
- loadMarketQuotes()
|
|
|
|
|
|
|
+ loadMarketQuotes(),
|
|
|
|
|
+ loadDomesticSummary()
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
@@ -75,6 +89,8 @@ export default async function Home() {
|
|
|
<div className="home__inner">
|
|
<div className="home__inner">
|
|
|
{worldIndices.length > 0 && <WorldMarketMap rows={worldIndices} />}
|
|
{worldIndices.length > 0 && <WorldMarketMap rows={worldIndices} />}
|
|
|
|
|
|
|
|
|
|
+ {domesticSummary.length > 0 && <DomesticSummary rows={domesticSummary} />}
|
|
|
|
|
+
|
|
|
{marketQuotes.length > 0 && <MajorQuotesGrid rows={marketQuotes} />}
|
|
{marketQuotes.length > 0 && <MajorQuotesGrid rows={marketQuotes} />}
|
|
|
|
|
|
|
|
<HomeBannerCarousel items={banners} />
|
|
<HomeBannerCarousel items={banners} />
|