@@ -57,37 +57,31 @@ export const CFormControlWrapper: FC<CFormControlWrapperProps> = ({
57
57
tooltipFeedback,
58
58
valid,
59
59
} ) => {
60
+ const formControlValidation = ( ) => (
61
+ < CFormControlValidation
62
+ describedby = { describedby }
63
+ feedback = { feedback }
64
+ feedbackInvalid = { feedbackInvalid }
65
+ feedbackValid = { feedbackValid }
66
+ floatingLabel = { floatingLabel }
67
+ invalid = { invalid }
68
+ tooltipFeedback = { tooltipFeedback }
69
+ valid = { valid }
70
+ />
71
+ )
60
72
return floatingLabel ? (
61
73
< CFormFloating className = { floatingClassName } >
62
74
{ children }
63
75
< CFormLabel htmlFor = { id } > { label || floatingLabel } </ CFormLabel >
64
76
{ text && < CFormText id = { describedby } > { text } </ CFormText > }
65
- < CFormControlValidation
66
- describedby = { describedby }
67
- feedback = { feedback }
68
- feedbackInvalid = { feedbackInvalid }
69
- feedbackValid = { feedbackValid }
70
- floatingLabel = { floatingLabel }
71
- invalid = { invalid }
72
- tooltipFeedback = { tooltipFeedback }
73
- valid = { valid }
74
- />
77
+ { formControlValidation ( ) }
75
78
</ CFormFloating >
76
79
) : (
77
80
< >
78
81
{ label && < CFormLabel htmlFor = { id } > { label } </ CFormLabel > }
79
82
{ children }
80
83
{ text && < CFormText id = { describedby } > { text } </ CFormText > }
81
- < CFormControlValidation
82
- describedby = { describedby }
83
- feedback = { feedback }
84
- feedbackInvalid = { feedbackInvalid }
85
- feedbackValid = { feedbackValid }
86
- floatingLabel = { floatingLabel }
87
- invalid = { invalid }
88
- tooltipFeedback = { tooltipFeedback }
89
- valid = { valid }
90
- />
84
+ { formControlValidation ( ) }
91
85
</ >
92
86
)
93
87
}
0 commit comments