260708_02_ENH: pdf 변환에 대한 공지 및 변환 상태 표기
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {downloadFile} from "@/lib/utils";
|
||||
import {buildWrittenReviewLink} from "@/config/gwcf.config";
|
||||
import {PDF_CONVERT_STATUS, PdfConvertStatus} from "@/types/gwcf";
|
||||
|
||||
const REVIEW_TIMESTAMP_PREFIX = /^\d{4}-\d{2}-\d{2}_\d{6}_/;
|
||||
|
||||
@@ -74,6 +75,27 @@ export const getReviewPdfDownloadName = (
|
||||
pdfFileName?: string
|
||||
) => removeTimestampPrefix(pdfFileName) || `review-pdf-${performanceId}-${reviewType}.pdf`;
|
||||
|
||||
export const getReviewPdfDisabled = (
|
||||
userId: string | undefined,
|
||||
pdfFileName?: string,
|
||||
pdfConvert?: PdfConvertStatus
|
||||
) => !userId || !pdfFileName || pdfConvert !== PDF_CONVERT_STATUS.COMPLETED;
|
||||
|
||||
export const getReviewPdfStatusLabel = (
|
||||
pdfConvert?: PdfConvertStatus
|
||||
) => {
|
||||
switch (pdfConvert) {
|
||||
case PDF_CONVERT_STATUS.COMPLETED:
|
||||
return "PDF";
|
||||
case PDF_CONVERT_STATUS.FAILED:
|
||||
case PDF_CONVERT_STATUS.NOT_TARGET:
|
||||
return "변환 실패";
|
||||
case PDF_CONVERT_STATUS.IN_PROGRESS:
|
||||
default:
|
||||
return "변환 중";
|
||||
}
|
||||
}
|
||||
|
||||
export const getEvidenceZipDownloadName = (performanceId: number, userId: string) =>
|
||||
`도착 증빙_${performanceId}_${userId}.zip`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user