Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/strapi-plugin-upload/admin/src/components/UploadList/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import React from 'react';
import PropTypes from 'prop-types';
import { pick } from 'lodash';
import Card from '../Card';
import CardControl from '../CardControl';
import CardControlsWrapper from '../CardControlsWrapper';
import InfiniteLoadingIndicator from '../InfiniteLoadingIndicator';
const RowItem = ({
file,
fileInfo,
hasError,
errorMessage,
isDownloading,
isUploading,
onClick,
onClickDeleteFileToUpload,
onClickEdit,
originalIndex,
}) => {
const url = file ? URL.createObjectURL(file) : null;
const handleClick = () => {
onClick(originalIndex);
};
const handleClickDelete = () => {
onClickDeleteFileToUpload(originalIndex);
};
const handleClickEdit = () => {
onClickEdit(originalIndex);
};
let fileSize = null;
if (file) {
fileSize = file.mime ? file.type : file.size / 1000;
}
const shouldDisplayControls = !isUploading && !isDownloading && file !== null;
const shouldDisplayTrashIcon = file === null && hasError;
const cardOptions = {
...pick(fileInfo, ['ext', 'name', 'mime', 'height', 'width', 'previewUrl', 'id']),
small: true,
errorMessage,
hasError,
type: file ? file.type : null,
size: fileSize,
url,
withFileCaching: false,
withoutFileInfo: isDownloading || (file === null && hasError),
};
return (
<div className="col-xs-12 col-md-6 col-xl-3" key={originalIndex}>
<Card options={cardOptions}>
{(isUploading || isDownloading) && <InfiniteLoadingIndicator onClick={handleClick} />}
{shouldDisplayTrashIcon && (
<CardControlsWrapper className="card-control-wrapper">
<CardControl title="delete" onClick={handleClickDelete} type="trash-alt" small />
</CardControlsWrapper>
)}
{shouldDisplayControls && (
<CardControlsWrapper className="card-control-wrapper">
<CardControl title="delete" onClick={handleClickDelete} type="trash-alt" small />
<CardControl title="edit" onClick={handleClickEdit} small />
</CardControlsWrapper>
)}
</Card>
</div>
);
};
RowItem.defaultProps = {
file: null,
errorMessage: null,
isDownloading: false,
};
RowItem.propTypes = {
file: PropTypes.object,
fileInfo: PropTypes.shape({
name: PropTypes.string.isRequired,
}).isRequired,
hasError: PropTypes.bool.isRequired,
errorMessage: PropTypes.string,
isDownloading: PropTypes.bool,
isUploading: PropTypes.bool.isRequired,
onClick: PropTypes.func.isRequired,
onClickDeleteFileToUpload: PropTypes.func.isRequired,
onClickEdit: PropTypes.func.isRequired,
originalIndex: PropTypes.number.isRequired,
};
export default RowItem;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0054 ]-- |