hi-tm 0.0.9 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const react_2 = require("react");
|
|
9
9
|
const image_1 = __importDefault(require("next/image"));
|
|
10
|
-
const SafeImage_1 = __importDefault(require("
|
|
10
|
+
const SafeImage_1 = __importDefault(require("../../../elements/SafeImage"));
|
|
11
11
|
// Simple Loader component defined inline to avoid import issues
|
|
12
12
|
const Loader = () => {
|
|
13
13
|
return (react_1.default.createElement("div", { className: "flex items-center justify-center" },
|
|
@@ -32,14 +32,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
const react_1 = __importStar(require("react"));
|
|
40
|
-
const image_1 = __importDefault(require("next/image"));
|
|
41
37
|
const SafeImage = ({ src, alt, width, height, className, fallbackSrc = '/images/imageDef.jpg', }) => {
|
|
42
38
|
const [imgSrc, setImgSrc] = (0, react_1.useState)(src || fallbackSrc);
|
|
43
|
-
return (react_1.default.createElement(
|
|
39
|
+
return (react_1.default.createElement("img", { src: imgSrc, alt: alt, width: width, height: height, className: className, onError: () => {
|
|
40
|
+
if (imgSrc !== fallbackSrc)
|
|
41
|
+
setImgSrc(fallbackSrc);
|
|
42
|
+
}, style: { objectFit: 'cover' } }));
|
|
44
43
|
};
|
|
45
44
|
exports.default = SafeImage;
|