reps pdf upload directory restructure
This commit is contained in:
@@ -9,6 +9,11 @@ import { connect } from "react-redux";
|
||||
import Dropzone, { useDropzone } from "react-dropzone";
|
||||
import { uploadFiles } from "../../actions";
|
||||
import { getContainers } from "../../actions/azurestorage";
|
||||
import {
|
||||
getFormCollectionByID,
|
||||
getThumbnailIconByExtension,
|
||||
bytesToSize,
|
||||
} from "../utils";
|
||||
|
||||
const required = (errorMsg) => (value) =>
|
||||
value || typeof value === "number" ? undefined : errorMsg;
|
||||
@@ -119,13 +124,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":
|
||||
|
||||
Reference in New Issue
Block a user