feat: integrate AmharicDatePicker for date input in ConfigDrivenSection

This commit is contained in:
estifanos
2026-08-11 09:59:17 +00:00
parent f0a933e1af
commit 41a5e96d6b

View File

@@ -13,7 +13,7 @@ import {
type FormSectionConfig, type FormSectionConfig,
type Vessel, type Vessel,
} from '@ema-platform/api'; } from '@ema-platform/api';
import { CountrySelect } from '@ema-platform/ui'; import { AmharicDatePicker, CountrySelect } from '@ema-platform/ui';
interface Props { interface Props {
section: FormSectionConfig; section: FormSectionConfig;
@@ -197,11 +197,16 @@ export function ConfigDrivenSection({
thousandSeparator={field.type === 'MONEY' ? ',' : undefined} thousandSeparator={field.type === 'MONEY' ? ',' : undefined}
/> />
) : field.type === 'DATE' ? ( ) : field.type === 'DATE' ? (
<TextInput // AmharicDatePicker has no `description`/`withAsterisk` props (from
{...common} // `common`) — pass `required` explicitly so the asterisk still shows.
type="date" <AmharicDatePicker
label={label}
error={error}
disabled={common.disabled}
required={field.required}
dateFormat="date"
value={(value as string) ?? ''} value={(value as string) ?? ''}
onChange={(e) => onChange(field.key, e.currentTarget.value)} onChange={(v) => onChange(field.key, v)}
/> />
) : field.type === 'TEXTAREA' ? ( ) : field.type === 'TEXTAREA' ? (
<Textarea <Textarea