@@ -59,32 +59,35 @@ const ResponsesList = ({ listType, ticketOptionResponses, ticketId }: ResponsesL
5959 const renderList = ( ) => {
6060 switch ( listType ) {
6161 case 'summary' :
62- const filteredResponses = ticketOptionResponses . filter (
63- ( option ) => option . optionType !== 'TEXT'
64- ) ;
65- console . log ( filteredResponses )
66- return (
67- < >
68- < div className = "flex justify-center" >
69- < div style = { { minWidth : '300px' , maxWidth : '600px' , width : '100%' } } >
70- < MultiplePieCharts responses = { filteredResponses } />
62+ {
63+ const filteredResponses = ticketOptionResponses . filter (
64+ ( option ) => option . optionType !== 'TEXT'
65+ ) ;
66+ return (
67+ < >
68+ < div className = "flex justify-center" >
69+ < div style = { { minWidth : '300px' , maxWidth : '600px' , width : '100%' } } >
70+ < MultiplePieCharts responses = { filteredResponses } />
71+ </ div >
7172 </ div >
72- </ div >
73- { renderTextResponses ( ticketOptionResponses ) }
74- </ >
75- ) ;
73+ { renderTextResponses ( ticketOptionResponses ) }
74+ </ >
75+ ) ;
76+ }
7677
7778 case 'individual' :
78- if ( isLoading ) return < p > 로딩 중...</ p > ;
79- if ( error || ! data ?. result ) return < p > 데이터를 불러오지 못했습니다.</ p > ;
80- const allOrders = data . result . flatMap ( user => user . orders ) ;
81- return (
82- < IndividualResponseViewer
83- orders = { allOrders }
84- currentIndex = { currentIndex }
85- setCurrentIndex = { setCurrentIndex }
86- />
87- ) ;
79+ {
80+ if ( isLoading ) return < p > 로딩 중...</ p > ;
81+ if ( error || ! data ?. result ) return < p > 데이터를 불러오지 못했습니다.</ p > ;
82+ const allOrders = data . result . flatMap ( user => user . orders ) ;
83+ return (
84+ < IndividualResponseViewer
85+ orders = { allOrders }
86+ currentIndex = { currentIndex }
87+ setCurrentIndex = { setCurrentIndex }
88+ />
89+ ) ;
90+ }
8891 default :
8992 return null ;
9093 }
0 commit comments