@@ -26,65 +26,56 @@ const ProviderIcon = forwardRef<any, ProviderIconProps>(
26
26
}
27
27
} , [ originProvider ] ) ;
28
28
29
+ const props = {
30
+ ref,
31
+ size,
32
+ ...Render ?. props ,
33
+ ...rest ,
34
+ } ;
35
+
29
36
switch ( type ) {
30
37
case 'avatar' : {
31
- if ( ! Render ?. Icon ) return < DefaultAvatar ref = { ref } size = { size } { ...rest } /> ;
32
- return < Render . Icon . Avatar ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } /> ;
38
+ if ( ! Render ?. Icon ) return < DefaultAvatar { ...props } /> ;
39
+ return < Render . Icon . Avatar { ...props } /> ;
33
40
}
34
41
case 'mono' : {
35
- if ( ! Render ?. Icon ) return < DefaultIcon ref = { ref } size = { size } { ...rest } /> ;
42
+ if ( ! Render ?. Icon ) return < DefaultIcon { ...props } /> ;
36
43
if ( ! forceMono && originProvider === ModelProvider . LobeHub ) {
37
44
// @ts -ignore
38
- return < Render . Icon . Color ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } /> ;
45
+ return < Render . Icon . Color { ...props } /> ;
39
46
}
40
- return < Render . Icon ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } /> ;
47
+ return < Render . Icon { ...props } /> ;
41
48
}
42
49
case 'color' : {
43
- if ( ! Render ?. Icon ) return < DefaultIcon ref = { ref } size = { size } { ...rest } /> ;
44
- return Render . Icon ?. Color ? (
45
- < Render . Icon . Color ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ...rest } />
46
- ) : (
47
- < Render . Icon ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ...rest } />
48
- ) ;
50
+ if ( ! Render ?. Icon ) return < DefaultIcon { ...props } /> ;
51
+ return Render . Icon ?. Color ? < Render . Icon . Color { ...props } /> : < Render . Icon { ...props } /> ;
49
52
}
50
53
case 'combine' : {
51
- if ( ! Render ?. Icon ) return < DefaultIcon ref = { ref } size = { size } { ...rest } /> ;
54
+ if ( ! Render ?. Icon ) return < DefaultIcon { ...props } /> ;
52
55
return Render . Icon ?. Combine ? (
53
- < Render . Icon . Combine ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } />
56
+ < Render . Icon . Combine type = { 'mono' } { ...props } />
54
57
) : Render . Icon ?. Brand ? (
55
- < Render . Icon . Brand ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } />
58
+ < Render . Icon . Brand { ...props } />
56
59
) : Render . Icon ?. Text ? (
57
- < Render . Icon . Text ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } />
60
+ < Render . Icon . Text { ...props } />
58
61
) : (
59
- < Render . Icon ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } />
62
+ < Render . Icon { ...props } />
60
63
) ;
61
64
}
62
65
case 'combine-color' : {
63
- if ( ! Render ?. Icon ) return < DefaultIcon ref = { ref } size = { size } { ...rest } /> ;
66
+ if ( ! Render ?. Icon ) return < DefaultIcon { ...props } /> ;
64
67
return Render . Icon ?. Combine ? (
65
- < Render . Icon . Combine
66
- ref = { ref }
67
- size = { size }
68
- type = { 'color' }
69
- { ...( Render ?. props || { } ) }
70
- { ...rest }
71
- />
68
+ < Render . Icon . Combine type = { 'color' } { ...props } />
72
69
) : Render . Icon ?. BrandColor ? (
73
- < Render . Icon . BrandColor
74
- ref = { ref }
75
- size = { size }
76
- type = { 'color' }
77
- { ...( Render ?. props || { } ) }
78
- { ...rest }
79
- />
70
+ < Render . Icon . BrandColor { ...props } />
80
71
) : Render . Icon ?. Text ? (
81
- < Render . Icon . Text ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } />
72
+ < Render . Icon . Text { ...props } />
82
73
) : (
83
- < Render . Icon ref = { ref } size = { size } { ...( Render ?. props || { } ) } { ... rest } />
74
+ < Render . Icon { ...props } />
84
75
) ;
85
76
}
86
77
default : {
87
- return < DefaultIcon ref = { ref } size = { size } { ...rest } /> ;
78
+ return < DefaultIcon { ...props } /> ;
88
79
}
89
80
}
90
81
} ,
0 commit comments