changes some status

This commit is contained in:
Jelaletdin12 committed 2026-10-02 17:43:37 +05:00
1 parent cbd17608c1
commit 6e626482f6
15 files changed
+553 -99

No files matched your search

+72 -16
View File
@@ -1,23 +1,79 @@
import type { SelectOption } from "@/components/formInput";
import { buildEnumOptions, getEnumLabel, type EnumConfig, type TranslateFn } from "@/constants/enumLabels";
export const EDUCATION_OPTIONS: SelectOption[] = [
{ value: "high", label: "Ýokary bilim" },
{ value: "unfinished_high", label: "Gutarylmadyk ýokary bilim" },
{ value: "masters", label: "Magistr" },
{ value: "phd", label: "Ylymlaryň doktory" },
{ value: "middle", label: "Orta mekdep" },
{ value: "school", label: "Orta bilim" },
{ value: "school_dropout", label: "Gutarylmadyk orta bilim" },
];
// ─── Education level ──────────────────────────────────────────────────────────
export const MARRIAGE_OPTIONS: SelectOption[] = [
{ value: "MARRIED", label: "Öýlenen / Durmuşa çykan" },
{ value: "SINGLE", label: "Öýlenmedik / Durmuşa çykmadyk" },
{ value: "DIVORCED", label: "Aýrylşan" },
{ value: "WIDOW", label: "Adamsy ýa-da aýaly aradan çykan" },
{ value: "LEGAL", label: "Raýat nika" },
];
export const EDUCATION_VALUES = [
"high",
"higher",
"unfinished_high",
"masters",
"phd",
"middle",
"secondary",
"school",
"school_dropout",
] as const;
export type EducationValue = (typeof EDUCATION_VALUES)[number];
export const EDUCATION_LABELS: Record<EducationValue, string> = {
high: "Higher secondary",
higher: "Higher education",
unfinished_high: "Incomplete higher secondary",
masters: "Master's degree",
phd: "Doctor of science",
middle: "Secondary school",
secondary: "Secondary education",
school: "Secondary education",
school_dropout: "Incomplete secondary education",
};
const EDUCATION_ENUM: EnumConfig<EducationValue> = {
values: EDUCATION_VALUES,
labels: EDUCATION_LABELS,
prefix: "options.education",
};
// ─── Marital status ───────────────────────────────────────────────────────────
export const MARRIAGE_VALUES = ["MARRIED", "SINGLE", "DIVORCED", "WIDOW", "LEGAL"] as const;
export type MarriageValue = (typeof MARRIAGE_VALUES)[number];
export const MARRIAGE_LABELS: Record<MarriageValue, string> = {
MARRIED: "Married",
SINGLE: "Single",
DIVORCED: "Divorced",
WIDOW: "Widowed",
LEGAL: "Not married / legally single",
};
const MARRIAGE_ENUM: EnumConfig<MarriageValue> = {
values: MARRIAGE_VALUES,
labels: MARRIAGE_LABELS,
prefix: "options.marriage",
};
// ─── Helpers ──────────────────────────────────────────────────────────────────
export function getEducationOptions(t?: TranslateFn): SelectOption[] {
return buildEnumOptions(EDUCATION_ENUM, t);
}
export function getEducationLabel(value: string, t?: TranslateFn): string {
return getEnumLabel(EDUCATION_ENUM, value, t);
}
export function getMarriageOptions(t?: TranslateFn): SelectOption[] {
return buildEnumOptions(MARRIAGE_ENUM, t);
}
export function getMarriageLabel(value: string, t?: TranslateFn): string {
return getEnumLabel(MARRIAGE_ENUM, value, t);
}
/** Month options for date pickers, "01" … "12". */
export const MONTH_OPTIONS: SelectOption[] = Array.from({ length: 12 }, (_, i) => {
const val = String(i + 1).padStart(2, "0");
return { value: val, label: val };