Update input field error/warning behavior and time picker handling
This commit is contained in:
@@ -93,6 +93,9 @@ const DaySchedule: React.FC<DayScheduleProps> = ({
|
||||
const duplicateTimeCount = day.doses.filter(d => d.time === dose.time).length;
|
||||
const hasDuplicateTime = duplicateTimeCount > 1;
|
||||
|
||||
// Check for zero dose
|
||||
const isZeroDose = dose.ldx === '0' || dose.ldx === '0.0';
|
||||
|
||||
return (
|
||||
<div key={dose.id} className="grid grid-cols-[120px_1fr_auto] gap-3 items-center">
|
||||
<FormTimeInput
|
||||
@@ -110,7 +113,9 @@ const DaySchedule: React.FC<DayScheduleProps> = ({
|
||||
min={0}
|
||||
unit="mg"
|
||||
required={true}
|
||||
warning={isZeroDose}
|
||||
errorMessage={t('errorNumberRequired')}
|
||||
warningMessage={t('warningZeroDose')}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => onRemoveDose(day.id, dose.id)}
|
||||
|
||||
Reference in New Issue
Block a user