1+ import { useNavigate } from '@tanstack/react-router' ;
12import { Descriptions , Modal , Spin , Table } from 'antd' ;
23
34import { Header } from '~/shared/components' ;
@@ -27,6 +28,7 @@ export default function UserDetailModal({
2728 graduationUserId,
2829 period,
2930} : UserDetailModalProps ) {
31+ const navigate = useNavigate ( ) ;
3032 const {
3133 data : studentDetail ,
3234 isLoading,
@@ -50,27 +52,32 @@ export default function UserDetailModal({
5052 dataIndex : 'stage' ,
5153 key : 'stage' ,
5254 render : ( _ : string , record : StageData ) => {
53- if ( record . isSubmitted ) {
54- return (
55- < button
56- type = 'button'
57- style = { {
58- background : 'none' ,
59- border : 'none' ,
60- padding : 0 ,
61- cursor : 'pointer' ,
62- color : vars . colors . main ,
63- textDecoration : 'underline' ,
64- } }
65- onClick = { ( ) => {
66- console . log ( '미리보기 구현' ) ;
67- } }
68- >
69- { record . stage }
70- </ button >
71- ) ;
72- }
73- return record . stage ;
55+ return record . isSubmitted && status ? (
56+ < button
57+ type = 'button'
58+ style = { {
59+ background : 'none' ,
60+ border : 'none' ,
61+ padding : 0 ,
62+ cursor : 'pointer' ,
63+ color : vars . colors . main ,
64+ textDecoration : 'underline' ,
65+ } }
66+ onClick = { ( ) => {
67+ navigate ( {
68+ to : '/file-preview' ,
69+ search : {
70+ fileId : record . fileId ! ,
71+ type : status . type ,
72+ } ,
73+ } ) ;
74+ } }
75+ >
76+ { record . stage }
77+ </ button >
78+ ) : (
79+ < span > { record . stage } </ span >
80+ ) ;
7481 } ,
7582 } ,
7683 { title : '일정' , dataIndex : 'period' , key : 'period' } ,
@@ -133,17 +140,15 @@ export default function UserDetailModal({
133140 </ Descriptions >
134141 </ Container >
135142
136- { status && (
137- < Container style = { { padding : '0px' } } >
138- < Table
139- dataSource = { stageData }
140- columns = { columns }
141- pagination = { false }
142- bordered
143- rowKey = 'key'
144- />
145- </ Container >
146- ) }
143+ < Container style = { { padding : '0px' } } >
144+ < Table
145+ dataSource = { stageData }
146+ columns = { columns }
147+ pagination = { false }
148+ bordered
149+ rowKey = 'key'
150+ />
151+ </ Container >
147152 </ >
148153 ) ;
149154 } ;
0 commit comments