fixed some ux components, added constants

This commit is contained in:
Jelaletdin12 committed 2026-08-12 20:10:20 +05:00
1 parent 6da59f42d9
commit 5073166931
30 files changed
+409 -425

No files matched your search

@@ -14,6 +14,7 @@ import type { IntlPaymentItem, IntlPaymentCreatePayload } from "../api/visaMaste
import { useCreateIntlPayment, useUpdateIntlPayment } from "../hooks/useVisaMasterPayments";
import { validateStep, DEFAULT_FORM_VALUES, buildPayload } from "../schemas/visaMasterPayment.schema";
import type { IntlPaymentFormData } from "../schemas/visaMasterPayment.schema";
import { PASSPORT_SERIES_OPTIONS, getStatusOptions } from "@/constants";
// ─── Types ────────────────────────────────────────────────────────────────────
@@ -26,24 +27,11 @@ type FlatErrors = Partial<Record<keyof IntlPaymentFormData, string>>;
// ─── Constants ────────────────────────────────────────────────────────────────
const STATUS_OPTIONS = [
{ value: "pending", label: "Garaşylýar" },
{ value: "approved", label: "Tassyklandy" },
{ value: "rejected", label: "Ret edildi" },
];
const CURRENCY_OPTIONS = [
{ value: "visa", label: "Visa" },
{ value: "mastercard", label: "MasterCard" },
];
const PASSPORT_SERIES_OPTIONS = [
{ value: "I", label: "I" },
{ value: "II", label: "II" },
{ value: "I-MR", label: "I-MR" },
{ value: "II-MR", label: "II-MR" },
];
const PROVINCE_OPTIONS = [
{ value: "ashgabat", label: "Aşgabat" },
{ value: "ahal", label: "Ahal" },
@@ -157,6 +145,8 @@ interface StepContentProps {
}
function StepGeneral({ form, errors, set, t }: StepContentProps) {
const statusOptions = useMemo(() => getStatusOptions(t, "intlPayment.status"), [t]);
return (
<BentoGrid cols={2}>
<BentoCard>
@@ -178,7 +168,7 @@ function StepGeneral({ form, errors, set, t }: StepContentProps) {
label={t("loanOrderForm.labels.status") || "Status"}
value={form.status}
onChange={(v) => set("status", v)}
options={STATUS_OPTIONS}
options={statusOptions}
error={errors.status}
required
/>