From 235f4bdb2966461271e0b703c4bdfed23834ffea Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 29 Apr 2025 19:43:14 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EC=97=85=EB=A1=9C=EB=93=9C?= =?UTF-8?q?=20=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20and=20porps=20=EB=B0=A9=EC=8B=9D=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/excel_download/index.tsx | 6 ++++ .../src/ui/file-upload/index.tsx | 30 ++++++++++++------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/packages/common/business_components/src/ui/excel_download/index.tsx b/packages/common/business_components/src/ui/excel_download/index.tsx index 46f8b7cb1..58ecf8a52 100644 --- a/packages/common/business_components/src/ui/excel_download/index.tsx +++ b/packages/common/business_components/src/ui/excel_download/index.tsx @@ -14,6 +14,9 @@ export const downloadExcel = ({ data, fileName = new Date().getTime().toString() //XLSX.write(workbook, { bookType: "xlsx", type: "binary" }); XLSX.writeFile(workbook, fileName + '.xlsx'); }; + + + export const filePicked=(oFile: File, headerNum:number=0):Promise =>{ // Create A File Reader HTML5 const reader = new FileReader(); @@ -28,10 +31,13 @@ export const filePicked=(oFile: File, headerNum:number=0):Promise void; // 파일 배열 세터 + fileTypes?: string; // 옵션 (파일 확장자 문자열) + } + export const FileUpload = -(({ ...props }) => { +({ files, setFiles, fileTypes }: FileUploadProps) => { return (

- Click to upload -   or drag and drop + 클릭 후 업로드 +   혹은 파일을 드래그 해주세요

- {!props?.fileTypes?"SVG, PNG, JPG, GIF":props?.fileTypes} + {!fileTypes?"SVG, PNG, JPG, GIF":fileTypes}

- {props.files && - props.files.length > 0 && - props.files.map((file:File, i:number) => ( + {files&& + files.length > 0 && + files.map((file:File, i:number) => ( {file.name} @@ -43,4 +51,4 @@ export const FileUpload =
) -}) \ No newline at end of file +} \ No newline at end of file