infinity-forge
Version:
59 lines • 4.44 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileItem = FileItem;
var jsx_runtime_1 = require("react/jsx-runtime");
var ui_1 = require("../../../../../../ui/index.js");
var button_upload_image_mobile_1 = require("./button-upload-image-mobile/index.js");
var S = __importStar(require("./styles.js"));
function FileItem(props) {
var _a, _b;
var _c = (0, ui_1.useFile)(props), loading = _c.loading, InputFile = _c.InputFile;
var _d = (0, ui_1.useRenderedFile)(props), Image = _d.Image, fileName = _d.fileName, ShowDetailFileButton = _d.ShowDetailFileButton, DeleteFileButton = _d.DeleteFileButton, DownloadButton = _d.DownloadButton, FileNameEditable = _d.FileNameEditable;
var Styles = ((_a = props === null || props === void 0 ? void 0 : props.inputFileConfigurations) === null || _a === void 0 ? void 0 : _a.styleVersion) === 'v2' ? S.FileItemVersion02 : S.FileItemVersion01;
return ((0, jsx_runtime_1.jsxs)(Styles, { children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'none' }, children: (0, jsx_runtime_1.jsx)(InputFile, {}) }), (0, jsx_runtime_1.jsx)("div", { className: 'image', children: loading ? (0, jsx_runtime_1.jsx)(ui_1.LoaderCircle, { size: 30, color: '#000' }) : (0, jsx_runtime_1.jsx)(Image, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: 'text', children: [(0, jsx_runtime_1.jsxs)("h3", { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'left', children: [props.enableMobileImage && ((0, jsx_runtime_1.jsx)("span", { className: 'font-13-regular type_size_file', children: props.isMobile ? 'Mobile' : 'Desktop' })), (0, jsx_runtime_1.jsx)("span", { className: 'font-13-regular file-name', children: (0, jsx_runtime_1.jsx)(FileNameEditable, {}) })] }), (props.sizeImageFile || props.sizeImageFileMobile) && ((0, jsx_runtime_1.jsxs)("span", { className: 'font-13-regular size', children: [!props.isMobile && ((0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconComputer' }), " ", props.sizeImageFile] })), !((_b = props === null || props === void 0 ? void 0 : props.mobile) === null || _b === void 0 ? void 0 : _b.mobileFilesAlredyExist) && props.enableMobileImage && ((0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconMobile' }), props.sizeImageFileMobile] }))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: 'actions', children: [(0, jsx_runtime_1.jsx)(ShowDetailFileButton, {}), (0, jsx_runtime_1.jsx)(DeleteFileButton, {}), (0, jsx_runtime_1.jsx)(DownloadButton, {}), (0, jsx_runtime_1.jsx)(button_upload_image_mobile_1.ButtonUploadImageMobile, __assign({}, props))] })] })] }));
}
//# sourceMappingURL=index.js.map