@@ -18,6 +18,12 @@ import Tooltip from "components/Tooltip/index";
1818// or as background job?
1919
2020export type ValidFileType = ".txt" | ".pdf" | ".doc" | ".docx" | ".md" ;
21+ export type TabIDs = "reports-review" | "study-abroad-planning" ;
22+ export enum TabIDsEnum {
23+ ReportsReview = "reports-review" ,
24+ StudyAbroadPlanning = "study-abroad-planning" ,
25+ }
26+
2127export function GetValidFileTypeList ( ) {
2228 return [ ".txt" , ".pdf" , ".doc" , ".docx" , ".md" ] ;
2329}
@@ -28,7 +34,7 @@ export function IsValidFileType(ext: string) {
2834}
2935
3036export interface FileCardCommonProps {
31- type : "review" ;
37+ tab : TabIDsEnum ;
3238
3339 className ?: string ;
3440
@@ -51,8 +57,6 @@ export interface FileCardNotDoneProps {
5157}
5258
5359export interface FileCardReviewProps {
54- type : "review" ;
55-
5660 done : true ;
5761 overview : string ;
5862 grade : number ;
@@ -77,8 +81,7 @@ export function FileCard(props: FileCardProps) {
7781 < div className = { s ( "file-info-wrap" ) } >
7882 < span className = { s ( "file-name" ) } > { props . filename } </ span >
7983 < span className = { s ( "file-size" ) } >
80- { " " }
81- { humanizeFileSize ( props . filesize ) } { " " }
84+ { humanizeFileSize ( props . filesize ) }
8285 </ span >
8386 </ div >
8487 </ div >
@@ -145,7 +148,7 @@ export function FileCard(props: FileCardProps) {
145148 </ div >
146149 { props . done && (
147150 < div className = { s ( "card vertical shadow" ) } >
148- { props . type === "review" && (
151+ { props . tab === TabIDsEnum . ReportsReview && (
149152 < div className = "w-full" >
150153 < h2 > 审核概述 </ h2 >
151154 < DashedSparator className = { s ( "my-4" ) } />
@@ -160,12 +163,10 @@ export function FileCard(props: FileCardProps) {
160163 "file-name text-indigo-500 dark:text-indigo-300"
161164 ) }
162165 >
163- { " " }
164- { props . filename } { " " }
166+ { props . filename }
165167 </ span >
166168 < span className = { s ( "file-size" ) } >
167- { " " }
168- { humanizeFileSize ( props . filesize ) } { " " }
169+ { humanizeFileSize ( props . filesize ) }
169170 </ span >
170171 </ div >
171172 </ div >
@@ -180,7 +181,7 @@ export function FileCard(props: FileCardProps) {
180181 />
181182 </ div >
182183 ) }
183- { props . type === "review" && (
184+ { props . tab === TabIDsEnum . ReportsReview && (
184185 < div className = "w-full" >
185186 < h2 > 评分结果 </ h2 >
186187 < span className = { s ( "grade" ) } > { props . grade } 分</ span >
0 commit comments