@@ -12,8 +12,8 @@ import {
12
12
import classNames from "classnames" ;
13
13
import { ItemMessage } from "../ItemMessage/ItemMessageCommon" ;
14
14
import { Spinner } from "../../Spinner/SpinnerCommon" ;
15
- import { ClickIcon } from "../../ClickIcon/ClickIconCommon" ;
16
- import { Icon } from "../../Icon/IconCommon" ;
15
+ import type { ClickIconProps } from "../../ClickIcon/ClickIconCommon" ;
16
+ import type { IconProps } from "../../Icon/IconCommon" ;
17
17
18
18
export const itemFileStates = {
19
19
success : "success" ,
@@ -31,9 +31,11 @@ export type ItemFileCommonProps = {
31
31
errorMessage ?: string ;
32
32
deleteIcon : string ;
33
33
ItemMessageComponent : ComponentType < ComponentProps < typeof ItemMessage > > ;
34
- ItemIconComponent : ComponentType < ComponentProps < typeof Icon > > ;
35
- ItemClickIconComponent : ComponentType < ComponentProps < typeof ClickIcon > > ;
34
+ ItemIconComponent : ComponentType < IconProps > ;
35
+ ItemClickIconComponent : ComponentType < ClickIconProps > ;
36
36
ItemSpinnerComponent : ComponentType < ComponentProps < typeof Spinner > > ;
37
+ deleteIconProps ?: Partial < ClickIconProps > ;
38
+ visiibilityIconProps ?: Partial < ClickIconProps > ;
37
39
} & ComponentPropsWithoutRef < "div" > ;
38
40
39
41
export const ItemFileCommon = ( {
@@ -47,6 +49,8 @@ export const ItemFileCommon = ({
47
49
ItemClickIconComponent,
48
50
ItemIconComponent,
49
51
ItemMessageComponent,
52
+ deleteIconProps = { } ,
53
+ visiibilityIconProps = { } ,
50
54
} : ItemFileCommonProps ) => {
51
55
const idHelp = useId ( ) ;
52
56
const idMessage = useId ( ) ;
@@ -89,11 +93,14 @@ export const ItemFileCommon = ({
89
93
< div className = "af-click-icon__content" >
90
94
{ state === "success" ? (
91
95
< >
92
- < ItemClickIconComponent src = { visibilityIcon } />
93
- < ItemClickIconComponent src = { deleteIcon } />
96
+ < ItemClickIconComponent
97
+ src = { visibilityIcon }
98
+ { ...visiibilityIconProps }
99
+ />
100
+ < ItemClickIconComponent src = { deleteIcon } { ...deleteIconProps } />
94
101
</ >
95
102
) : (
96
- < ItemClickIconComponent src = { deleteIcon } />
103
+ < ItemClickIconComponent src = { deleteIcon } { ... deleteIconProps } />
97
104
) }
98
105
</ div >
99
106
{ helper && (
0 commit comments