fix(SW-667): add ErrorMessage
This commit is contained in:
@@ -10,6 +10,7 @@ import { dt } from "@/lib/dt"
|
||||
import Select from "@/components/TempDesignSystem/Select"
|
||||
import { rangeArray } from "@/utils/rangeArray"
|
||||
|
||||
import ErrorMessage from "../ErrorMessage"
|
||||
import { DateName } from "./date"
|
||||
|
||||
import styles from "./date.module.css"
|
||||
@@ -21,7 +22,7 @@ import type { DateProps } from "./date"
|
||||
export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
||||
const intl = useIntl()
|
||||
const currentValue = useWatch({ name })
|
||||
const { control, setValue, trigger } = useFormContext()
|
||||
const { control, setValue, trigger, formState } = useFormContext()
|
||||
const { field } = useController({
|
||||
control,
|
||||
name,
|
||||
@@ -204,6 +205,7 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
||||
}}
|
||||
</DateInput>
|
||||
</Group>
|
||||
<ErrorMessage errors={formState.errors} name={field.name} />
|
||||
</DatePicker>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user