forstok-ui-lib 8.4.1 → 8.4.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "8.4.1",
3
+ "version": "8.4.2",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -1,17 +1,26 @@
1
- import type { ImgHTMLAttributes, ReactEventHandler } from 'react';
2
- import ImagePlaceholder from '../../assets/images/image-placeholder.jpg';
3
- import { ImageContainer } from './styles';
1
+ import type { ImgHTMLAttributes, ReactEventHandler } from "react";
2
+ import ImagePlaceholder from "../../assets/images/image-placeholder.jpg";
3
+ import { ImageContainer } from "./styles";
4
4
 
5
5
  type TImage = ImgHTMLAttributes<HTMLImageElement> & {
6
- $mode?: string
7
- }
6
+ $mode?: string;
7
+ };
8
8
 
9
- const ImageComponent = ({ $mode, ...props }: TImage) => {
9
+ const ImageComponent = ({ $mode, onError, ...props }: TImage) => {
10
10
  const { width, height } = props;
11
- const evError: ReactEventHandler<HTMLImageElement> = e => {
11
+ const evError: ReactEventHandler<HTMLImageElement> = (e) => {
12
12
  (e.target as HTMLImageElement).src = ImagePlaceholder;
13
- }
14
- return <ImageContainer $mode={$mode} width={width} height={height} onError={evError} {...props} />;
15
- }
13
+ onError?.(e);
14
+ };
15
+ return (
16
+ <ImageContainer
17
+ $mode={$mode}
18
+ width={width}
19
+ height={height}
20
+ onError={evError}
21
+ {...props}
22
+ />
23
+ );
24
+ };
16
25
 
17
- export default ImageComponent;
26
+ export default ImageComponent;