File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/Shared/Components/DatePicker Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import { DateTimePickerProps } from './types'
31
31
import { DATE_PICKER_IDS , DATE_PICKER_PLACEHOLDER , customDayStyles } from './constants'
32
32
import './datePicker.scss'
33
33
import { ReactComponent as CalendarIcon } from '../../../Assets/Icon/ic-calendar.svg'
34
+ import { ReactComponent as ICWarning } from '../../../Assets/Icon/ic-warning.svg'
34
35
import { DATE_TIME_FORMATS } from '../../../Common'
35
36
import 'react-dates/initialize'
36
37
import 'react-dates/lib/css/_datepicker.css'
@@ -51,6 +52,7 @@ const DateTimePicker = ({
51
52
dataTestIdForTime = DATE_PICKER_IDS . TIME ,
52
53
dataTestidForDate = DATE_PICKER_IDS . DATE ,
53
54
openDirection = 'down' ,
55
+ error = '' ,
54
56
} : DateTimePickerProps ) => {
55
57
const time = getTimeValue ( dateObject )
56
58
const selectedTimeOption = DEFAULT_TIME_OPTIONS . find ( ( option ) => option . value === time ) ?? DEFAULT_TIME_OPTIONS [ 0 ]
@@ -122,6 +124,12 @@ const DateTimePicker = ({
122
124
</ div >
123
125
) }
124
126
</ div >
127
+ { error && (
128
+ < div className = "form__error" >
129
+ < ICWarning className = "form__icon form__icon--error" />
130
+ { error }
131
+ </ div >
132
+ ) }
125
133
</ div >
126
134
)
127
135
}
You can’t perform that action at this time.
0 commit comments