import React, { forwardRef } from 'react'; import { type CropZoomProps } from '../../components/crop/types'; export default function withCropValidation( Component: React.ComponentType

) { return forwardRef((props, ref) => { const { minScale, maxScale } = props; if (minScale !== undefined && minScale < 1) { throw new Error('minScale property must be greater than or equals one'); } if (maxScale !== undefined && maxScale < 1) { throw new Error('maxScale property must be greater than or equals one'); } if ( minScale !== undefined && maxScale !== undefined && minScale > maxScale ) { throw new Error('minScale property must not be greater than maxScale'); } return ; }); }