1- import { STOCK_SECTOR_MAP , StockSectorKey } from '@ts/StockSector' ;
21import { getDiffText } from '@utils/Number' ;
32import { deltaToCaret } from '@utils/ScoreConvert' ;
43import useAboutHumanZipyo from '@components/Modal/CenterTutorial/AboutHumanZipyo/useAboutHumanZipyo' ;
54import GuageChart from '@components/Search/GuageChart/GuageChart' ;
6- import { useScoreQuery } from '@controllers/stocks/query' ;
5+ import { useScoreQuery , useStockZipyoDataQuery } from '@controllers/stocks/query' ;
76import { StockDetailInfo } from '@controllers/stocks/types' ;
87import { StockItemContainer } from '../../Common.Style' ;
98import StockItemTitle from '../../ItemTitle' ;
@@ -17,25 +16,12 @@ import {
1716
1817const StockZipyoPanel = ( { stockInfo : { stockId, country, symbolName } } : { stockInfo : StockDetailInfo } ) => {
1918 const { data : stockScore } = useScoreQuery ( stockId , country ) ;
19+ const { data : zipyoData } = useStockZipyoDataQuery ( stockId , country ) ;
2020 const { Modal : AboutHumanZipyoModal , openModal : openAboutHumanZipyoModal } = useAboutHumanZipyo ( ) ;
2121
22- if ( ! stockScore ) return null ;
22+ if ( ! stockScore || ! zipyoData ) return null ;
2323
24- // 목업 데이터 (실제로는 API에서 가져와야 함)
25- const mock : {
26- industryType : StockSectorKey ;
27- industryAverage : number ;
28- stockRanking : number ;
29- monthlyAverage : number ;
30- } = {
31- industryType : 'IT_SERVICE' ,
32- industryAverage : 45 ,
33- stockRanking : 68 ,
34- monthlyAverage : 51 ,
35- } ;
36-
37- const { industryType, industryAverage, stockRanking, monthlyAverage } = mock ;
38- const industryName = STOCK_SECTOR_MAP [ industryType ] . text ;
24+ const { industryName, industryAverage, stockRanking, monthlyAverage } = zipyoData ;
3925 const monthlyAverageDiff = stockScore . score - monthlyAverage ;
4026 const monthlyAverageDiffText = getDiffText ( { valueDiff : monthlyAverageDiff } ) ;
4127 const sentiment = ! monthlyAverageDiff ? '유지되고' : monthlyAverageDiff > 0 ? '개선되고' : '약화되고' ;
0 commit comments