Repository URL to install this package:
|
Version:
3.12.20 ▾
|
import { useDispatch, useSelector } from 'react-redux';
import { SlideTransition } from '@filerobot/common';
import { selectCropPanelFile, cropPanelFileSet } from '../../slices/panels.slice';
import CropPanelContent from './CropPanelContent';
import { jsx as _jsx } from "react/jsx-runtime";
var CropPanel = function CropPanel(_ref) {
var zIndex = _ref.zIndex;
var dispatch = useDispatch();
// uses crop panel for specific state, for future supporting files for crop, and others for download (in-case it's needed)
var cropPanelFile = useSelector(selectCropPanelFile);
var closeCropPanel = function closeCropPanel() {
return dispatch(cropPanelFileSet(null));
};
return /*#__PURE__*/_jsx(SlideTransition, {
zIndex: zIndex,
handleClose: closeCropPanel,
children: cropPanelFile && /*#__PURE__*/_jsx(CropPanelContent, {
imageFile: cropPanelFile
})
});
};
export default CropPanel;