reps pdf upload directory restructure
This commit is contained in:
@@ -20,6 +20,12 @@ import {
|
||||
import { setFilesForAppeal } from "../../store/appealType/action";
|
||||
import Link from "next/link";
|
||||
|
||||
import {
|
||||
getFormCollectionByID,
|
||||
getThumbnailIconByExtension,
|
||||
bytesToSize,
|
||||
} from "../utils";
|
||||
|
||||
import {
|
||||
addYears,
|
||||
addMonths,
|
||||
@@ -1309,13 +1315,6 @@ const RenderFileUpload = (field) => {
|
||||
</div>
|
||||
));
|
||||
|
||||
function bytesToSize(bytes) {
|
||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
if (bytes == 0) return "0 Byte";
|
||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
||||
}
|
||||
|
||||
const getThumbnailIcon = (fileObj, fileType) => {
|
||||
switch (fileType) {
|
||||
case "text/html":
|
||||
@@ -1353,47 +1352,6 @@ const RenderFileUpload = (field) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getThumbnailIconByExtension = (blobName) => {
|
||||
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
|
||||
|
||||
switch (fileType) {
|
||||
case "html":
|
||||
return "/assets/images/documenttypes/html.png";
|
||||
break;
|
||||
case "txt":
|
||||
return "/assets/images/documenttypes/txt.png";
|
||||
break;
|
||||
case "doc":
|
||||
return "/assets/images/documenttypes/doc.png";
|
||||
break;
|
||||
case "pdf":
|
||||
return "/assets/images/documenttypes/pdf.png";
|
||||
break;
|
||||
case "docx":
|
||||
return "/assets/images/documenttypes/docx.png";
|
||||
break;
|
||||
case "csv":
|
||||
return "/assets/images/documenttypes/csv.png";
|
||||
break;
|
||||
case "xlsx":
|
||||
return "/assets/images/documenttypes/xlsx.png";
|
||||
break;
|
||||
|
||||
case "zip":
|
||||
return "/assets/images/documenttypes/zip.png";
|
||||
break;
|
||||
case "jpeg":
|
||||
case "jpg":
|
||||
return "/assets/images/documenttypes/jpg.png";
|
||||
case "png":
|
||||
return "/assets/images/documenttypes/png.png";
|
||||
break;
|
||||
default:
|
||||
return "/assets/images/documenttypes/txt.png";
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const getDocumentType = (docCode) => {
|
||||
switch (docCode) {
|
||||
case "000001":
|
||||
|
||||
Reference in New Issue
Block a user