+ Caution! You are about to delete a short URL.
+ This action cannot be undone. Once you have deleted it, all the visits stats will be lost.
- resetDeleteShortUrl();
- }
+ setInputValue(e.target.value)}
+ />
- render() {
- const { shortUrl, toggle, isOpen, shortUrlDeletion, resetDeleteShortUrl } = this.props;
- const { error, errorData } = shortUrlDeletion;
- const errorCode = error && (errorData.type || errorData.error);
- const hasThresholdError = errorCode === THRESHOLD_REACHED;
- const hasErrorOtherThanThreshold = error && errorCode !== THRESHOLD_REACHED;
- const close = pipe(resetDeleteShortUrl, toggle);
+ {hasThresholdError && (
+
+ {errorData.threshold && `This short URL has received more than ${errorData.threshold} visits, and therefore, it cannot be deleted.`}
+ {!errorData.threshold && 'This short URL has received too many visits, and therefore, it cannot be deleted.'}
+
+ )}
+ {hasErrorOtherThanThreshold && (
+
+ Something went wrong while deleting the URL :(
+
+ )}
+
+