import type { Milestone } from "../lib/types"; import { JalaliDatePicker } from "./JalaliDatePicker"; import { NumberInput } from "./NumberInput"; export interface MilestoneRowProps { milestone: Milestone; onChange: (m: Milestone) => void; onRemove: () => void; disabled?: boolean; } // یک ردیف مرحله‌ی پرداخت: تاریخ + مبلغ + دکمه‌ی حذف export function MilestoneRow({ milestone, onChange, onRemove, disabled = false }: MilestoneRowProps) { return (
{/* کادر انتخاب تاریخ — جمع‌وجور و دقیقاً متناسب با فرمت تاریخ */}
onChange({ ...milestone, when_iso: iso })} placeholder="تاریخ" disabled={disabled} />
{/* کادر ورود مبلغ — کشیده و پرکننده حداکثری عرض صفحه */}
onChange({ ...milestone, amount })} placeholder="مبلغ (تومان)" showWords disabled={disabled} />
{/* دکمه حذف */} {!disabled && ( )}
); }