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/InputMedia/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import React, { useState } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { useIntl } from 'react-intl';
import { getTrad } from '../../utils';
import IconUpload from './IconUpload';
const EmptyInputMediaWrapper = styled.div`
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
border-radius: ${({ theme }) => theme.main.sizes.borderRadius};
background-color: ${({ theme, isInDropZone }) =>
isInDropZone ? '#515764' : theme.main.colors.black};
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
& * {
pointer-events: none;
}
`;
const EmptyInputMedia = ({ children, ...props }) => {
const { formatMessage } = useIntl();
const [isInDropZone, setIsInDropZone] = useState(false);
const handleDragEnter = () => setIsInDropZone(true);
const handleResetDropZone = () => setIsInDropZone(false);
const titleSvgTranslate = formatMessage({ id: getTrad('input.placeholder.icon') });
return (
<EmptyInputMediaWrapper
{...props}
onDragEnter={handleDragEnter}
onDragLeave={handleResetDropZone}
onDrop={handleResetDropZone}
isInDropZone={isInDropZone}
>
<IconUpload title={titleSvgTranslate} />
{isInDropZone ? null : children}
</EmptyInputMediaWrapper>
);
};
EmptyInputMedia.propTypes = {
disabled: PropTypes.bool,
children: PropTypes.node.isRequired,
};
EmptyInputMedia.defaultProps = {
disabled: false,
};
export default EmptyInputMedia;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0063 ]-- |