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