+
{t('table.filters', 'Filters')}
diff --git a/src/components/formInput.tsx b/src/components/formInput.tsx
new file mode 100644
index 0000000..c160e84
--- /dev/null
+++ b/src/components/formInput.tsx
@@ -0,0 +1,655 @@
+import { useState, useRef } from 'react'
+import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'
+import { Check, ChevronsUpDown, Search, X, Eye, EyeOff, Upload, Hash } from 'lucide-react'
+
+import { cn } from '@/lib/utils'
+import { Input } from '@/components/ui/input'
+import { Textarea } from '@/components/ui/textarea'
+import { Button } from '@/components/ui/button'
+import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
+import { Calendar } from '@/components/ui/calendar'
+import { format, parse, isValid } from 'date-fns'
+import { CalendarIcon } from 'lucide-react'
+
+// ─── Collapsible aliases ──────────────────────────────────────────────────────
+
+const Collapsible = CollapsiblePrimitive.Root
+const CollapsibleTrigger = CollapsiblePrimitive.Trigger
+const CollapsibleContent = CollapsiblePrimitive.Content
+
+// ─── Types ────────────────────────────────────────────────────────────────────
+
+export type FormInputType =
+ | 'text'
+ | 'number'
+ | 'phone'
+ | 'email'
+ | 'password'
+ | 'date'
+ | 'select'
+ | 'searchable-select'
+ | 'file'
+ | 'textarea'
+
+export interface SelectOption {
+ value: string
+ label: string
+}
+
+export interface FormInputProps {
+ type?: FormInputType
+ label?: string
+ value?: string
+ onChange?: (value: string) => void
+ placeholder?: string
+ error?: string
+ required?: boolean
+ disabled?: boolean
+ options?: SelectOption[]
+ accept?: string
+ onFileChange?: (file: File | null) => void
+ fileValue?: File | null
+ className?: string
+ phonePrefix?: string
+ rows?: number
+ name?: string
+ readOnly?: boolean
+}
+
+// ─── FieldLabel ───────────────────────────────────────────────────────────────
+
+function FieldLabel({ label, required }: { label?: string; required?: boolean }) {
+ if (!label) return null
+ return (
+
+ )
+}
+
+// ─── ErrorMsg ─────────────────────────────────────────────────────────────────
+
+function ErrorMsg({ error }: { error?: string }) {
+ if (!error) return null
+ return (
+
+
+ {error}
+
+ )
+}
+
+// ─── error border helper ──────────────────────────────────────────────────────
+
+const withError = (error?: string) =>
+ error ? 'border-destructive focus-visible:ring-destructive/30' : ''
+
+// ─── TextInput ────────────────────────────────────────────────────────────────
+
+function TextInput({
+ type = 'text',
+ value = '',
+ onChange,
+ placeholder,
+ error,
+ disabled,
+ required,
+ label,
+ className,
+ name,
+ readOnly,
+ rows = 3,
+}: FormInputProps) {
+ const [showPass, setShowPass] = useState(false)
+
+ const isPassword = type === 'password'
+ const isTextarea = type === 'textarea'
+ const isNumber = type === 'number'
+
+ return (
+
+
+
+
+ {isTextarea ? (
+
+
+
+
+ )
+}
+
+// ─── PhoneInput ───────────────────────────────────────────────────────────────
+
+function PhoneInput({
+ value = '',
+ onChange,
+ placeholder = '61 097 651',
+ error,
+ disabled,
+ required,
+ label,
+ className,
+ phonePrefix = '+993',
+}: FormInputProps) {
+ return (
+
+
+
+
+
+ {phonePrefix}
+
+
onChange?.(e.target.value.replace(/[^\d\s-]/g, ''))}
+ placeholder={placeholder}
+ disabled={disabled}
+ className="flex-1 h-full px-3 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none disabled:cursor-not-allowed"
+ />
+
+
+
+
+ )
+}
+
+// ─── DateInput (shadcn Popover + Calendar) ───────────────────────────────────
+
+function DateInput({
+ value = '',
+ onChange,
+ error,
+ disabled,
+ required,
+ label,
+ className,
+ placeholder = 'Sene saýlaň',
+}: FormInputProps) {
+ const [open, setOpen] = useState(false)
+
+ // value is stored as 'yyyy-MM-dd' string
+ const parsed = value ? parse(value, 'yyyy-MM-dd', new Date()) : undefined
+ const selected = parsed && isValid(parsed) ? parsed : undefined
+
+ const handleSelect = (day: Date | undefined) => {
+ onChange?.(day ? format(day, 'yyyy-MM-dd') : '')
+ setOpen(false)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+// ─── SelectInput ──────────────────────────────────────────────────────────────
+
+// ─── SelectInput ──────────────────────────────────────────────────────────────
+// Artık Collapsible tabanlı — SearchableSelect ile aynı mekanizma
+
+function SelectInput({
+ value = '',
+ onChange,
+ options = [],
+ placeholder = '—',
+ error,
+ disabled,
+ required,
+ label,
+ className,
+}: FormInputProps) {
+ const [open, setOpen] = useState(false)
+
+ const selected = options.find((o) => o.value === value)
+
+ const handleSelect = (val: string) => {
+ onChange?.(val)
+ setOpen(false)
+ }
+
+ return (
+
+
+
+
{
+ if (!disabled) setOpen(next)
+ }}
+ >
+
+
+
+
+
+
+ {options.map((opt) => {
+ const isSelected = opt.value === value
+ return (
+
+ )
+ })}
+
+
+
+
+
+
+ )
+}
+
+// ─── SearchableSelect ─────────────────────────────────────────────────────────
+// Uses Radix Collapsible — no portal, no z-index issues, natural document flow.
+// onMouseDown (not onClick) on options prevents the trigger's onBlur from
+// firing before the selection is registered.
+
+function SearchableSelect({
+ value = '',
+ onChange,
+ options = [],
+ placeholder = 'Saýlamak üçin basyň',
+ error,
+ disabled,
+ required,
+ label,
+ className,
+}: FormInputProps) {
+ const [open, setOpen] = useState(false)
+ const [query, setQuery] = useState('')
+ const searchRef = useRef
(null)
+
+ const selected = options.find((o) => o.value === value)
+ const filtered = query.trim()
+ ? options.filter((o) => o.label.toLowerCase().includes(query.toLowerCase()))
+ : options
+
+ const openDropdown = () => {
+ setOpen(true)
+ // Focus search after Collapsible animation frame
+ requestAnimationFrame(() => searchRef.current?.focus())
+ }
+
+ const closeDropdown = () => {
+ setOpen(false)
+ setQuery('')
+ }
+
+ const handleSelect = (val: string) => {
+ onChange?.(val)
+ closeDropdown()
+ }
+
+ const handleClear = (e: React.MouseEvent) => {
+ e.preventDefault()
+ e.stopPropagation()
+ onChange?.('')
+ }
+
+ return (
+
+
+
+
{ if (!disabled) { if (next) { openDropdown() } else { closeDropdown() } } }}>
+ {/* Trigger */}
+
+
+
+
+ {/* Panel */}
+
+ {/* Search */}
+
+
+ setQuery(e.target.value)}
+ placeholder="Gözle..."
+ className="flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none"
+ />
+ {query && (
+
+ )}
+
+
+ {/* Options */}
+
+ {filtered.length === 0 ? (
+
+ Netije tapylmady
+
+ ) : (
+ filtered.map((opt) => {
+ const isSelected = opt.value === value
+ return (
+
+ )
+ })
+ )}
+
+
+
+
+
+
+ )
+}
+
+// ─── FileInput ────────────────────────────────────────────────────────────────
+
+function FileInput({
+ label,
+ required,
+ error,
+ disabled,
+ accept = 'image/*',
+ onFileChange,
+ fileValue,
+ className,
+ placeholder = 'Faýl saýlaň ýa-da salmak üçin basyň',
+}: FormInputProps) {
+ const inputRef = useRef(null)
+ const [dragOver, setDragOver] = useState(false)
+ const [preview, setPreview] = useState(null)
+
+ const handleFile = (file: File | null) => {
+ onFileChange?.(file)
+ if (file?.type.startsWith('image/')) {
+ setPreview(URL.createObjectURL(file))
+ } else {
+ setPreview(null)
+ }
+ }
+
+ const handleDrop = (e: React.DragEvent) => {
+ e.preventDefault()
+ setDragOver(false)
+ handleFile(e.dataTransfer.files[0] ?? null)
+ }
+
+ const isImage = fileValue?.type.startsWith('image/')
+
+ return (
+
+
+
+
!disabled && inputRef.current?.click()}
+ onKeyDown={(e) => e.key === 'Enter' && !disabled && inputRef.current?.click()}
+ onDragOver={(e) => { e.preventDefault(); setDragOver(true) }}
+ onDragLeave={() => setDragOver(false)}
+ onDrop={handleDrop}
+ className={cn(
+ 'relative flex flex-col items-center justify-center',
+ 'min-h-[88px] rounded-md border-2 border-dashed cursor-pointer select-none',
+ 'transition-all duration-200',
+ 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2',
+ dragOver && 'border-primary bg-primary/5 scale-[1.01]',
+ error ? 'border-destructive/60' : 'border-border',
+ !dragOver && !error && 'hover:border-primary/50 hover:bg-muted/20',
+ disabled && 'opacity-50 cursor-not-allowed pointer-events-none',
+ fileValue && isImage && '!border-solid !border-border p-0 overflow-hidden',
+ )}
+ >
+ {fileValue && isImage && preview ? (
+ <>
+

+
+ >
+ ) : fileValue ? (
+
+
+
+
+
+ {fileValue.name}
+
+
+
+ ) : (
+
+
+
+
+
+ {placeholder}
+
+
+ )}
+
+
+
handleFile(e.target.files?.[0] ?? null)}
+ className="hidden"
+ />
+
+
+
+ )
+}
+
+// ─── FormInput (router) ───────────────────────────────────────────────────────
+
+export function FormInput(props: FormInputProps) {
+ const { type = 'text' } = props
+
+ if (type === 'phone') return
+ if (type === 'date') return
+ if (type === 'select') return
+ if (type === 'searchable-select') return
+ if (type === 'file') return
+ if (type === 'textarea') return
+ return
+}
\ No newline at end of file
diff --git a/src/components/tableButton.tsx b/src/components/tableButton.tsx
index 14552dd..a650d66 100644
--- a/src/components/tableButton.tsx
+++ b/src/components/tableButton.tsx
@@ -25,7 +25,7 @@ export function TableActionButton({
disabled={disabled}
variant={variant === 'destructive' ? 'destructive' : variant === 'secondary' ? 'secondary' : 'default'}
className={cn(
- 'font-medium text-sm h-9 px-4 transition-colors shadow-sm',
+ 'font-medium text-sm h-9 px-4 transition-colors shadow-sm cursor-pointer',
className
)}
>
diff --git a/src/components/tableSearch.tsx b/src/components/tableSearch.tsx
index f4a77be..46196a6 100644
--- a/src/components/tableSearch.tsx
+++ b/src/components/tableSearch.tsx
@@ -31,7 +31,7 @@ export function TableSearchInput({
className={cn(
'h-9 w-64 rounded-md border border-border bg-background pl-9 pr-3',
'text-sm text-foreground placeholder:text-muted-foreground',
- 'focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent',
+ 'focus:outline-none focus:ring-1 focus:ring-ring focus:border-transparent',
'transition-colors'
)}
/>
diff --git a/src/components/ui/accordion.tsx b/src/components/ui/accordion.tsx
index fcfee5c..ebd461c 100644
--- a/src/components/ui/accordion.tsx
+++ b/src/components/ui/accordion.tsx
@@ -40,7 +40,7 @@ function AccordionTrigger({
& {
+ buttonVariant?: React.ComponentProps["variant"]
+}) {
+ const defaultClassNames = getDefaultClassNames()
+
+ return (
+ svg]:rotate-180`,
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
+ className
+ )}
+ captionLayout={captionLayout}
+ locale={locale}
+ formatters={{
+ formatMonthDropdown: (date) =>
+ date.toLocaleString(locale?.code, { month: "short" }),
+ ...formatters,
+ }}
+ classNames={{
+ root: cn("w-fit", defaultClassNames.root),
+ months: cn(
+ "relative flex flex-col gap-4 md:flex-row",
+ defaultClassNames.months
+ ),
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
+ nav: cn(
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
+ defaultClassNames.nav
+ ),
+ button_previous: cn(
+ buttonVariants({ variant: buttonVariant }),
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
+ defaultClassNames.button_previous
+ ),
+ button_next: cn(
+ buttonVariants({ variant: buttonVariant }),
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
+ defaultClassNames.button_next
+ ),
+ month_caption: cn(
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
+ defaultClassNames.month_caption
+ ),
+ dropdowns: cn(
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
+ defaultClassNames.dropdowns
+ ),
+ dropdown_root: cn(
+ "relative rounded-(--cell-radius)",
+ defaultClassNames.dropdown_root
+ ),
+ dropdown: cn(
+ "absolute inset-0 bg-popover opacity-0",
+ defaultClassNames.dropdown
+ ),
+ caption_label: cn(
+ "font-medium select-none",
+ captionLayout === "label"
+ ? "text-sm"
+ : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
+ defaultClassNames.caption_label
+ ),
+ table: "w-full border-collapse",
+ weekdays: cn("flex", defaultClassNames.weekdays),
+ weekday: cn(
+ "flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
+ defaultClassNames.weekday
+ ),
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
+ week_number_header: cn(
+ "w-(--cell-size) select-none",
+ defaultClassNames.week_number_header
+ ),
+ week_number: cn(
+ "text-[0.8rem] text-muted-foreground select-none",
+ defaultClassNames.week_number
+ ),
+ day: cn(
+ "group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
+ props.showWeekNumber
+ ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
+ : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
+ defaultClassNames.day
+ ),
+ range_start: cn(
+ "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
+ defaultClassNames.range_start
+ ),
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
+ range_end: cn(
+ "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
+ defaultClassNames.range_end
+ ),
+ today: cn(
+ "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
+ defaultClassNames.today
+ ),
+ outside: cn(
+ "text-muted-foreground aria-selected:text-muted-foreground",
+ defaultClassNames.outside
+ ),
+ disabled: cn(
+ "text-muted-foreground opacity-50",
+ defaultClassNames.disabled
+ ),
+ hidden: cn("invisible", defaultClassNames.hidden),
+ ...classNames,
+ }}
+ components={{
+ Root: ({ className, rootRef, ...props }) => {
+ return (
+
+ )
+ },
+ Chevron: ({ className, orientation, ...props }) => {
+ if (orientation === "left") {
+ return (
+
+ )
+ }
+
+ if (orientation === "right") {
+ return (
+
+ )
+ }
+
+ return (
+
+ )
+ },
+ DayButton: ({ ...props }) => (
+
+ ),
+ WeekNumber: ({ children, ...props }) => {
+ return (
+
+
+ {children}
+
+ |
+ )
+ },
+ ...components,
+ }}
+ {...props}
+ />
+ )
+}
+
+function CalendarDayButton({
+ className,
+ day,
+ modifiers,
+ locale,
+ ...props
+}: React.ComponentProps & { locale?: Partial }) {
+ const defaultClassNames = getDefaultClassNames()
+
+ const ref = React.useRef(null)
+ React.useEffect(() => {
+ if (modifiers.focused) ref.current?.focus()
+ }, [modifiers.focused])
+
+ return (
+
diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts
index 2fb529f..0b7cb3a 100644
--- a/src/lib/i18n/index.ts
+++ b/src/lib/i18n/index.ts
@@ -8,7 +8,18 @@ import tk from './locales/tk.json'
export const SUPPORTED_LANGUAGES = ['en', 'ru', 'tk'] as const
export type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number]
-const savedLang = localStorage.getItem('tbbank-lang') as SupportedLanguage | null
+const savedStorage = localStorage.getItem('tbbank-lang')
+let savedLang: string | null = null
+
+if (savedStorage) {
+ try {
+ const parsed = JSON.parse(savedStorage)
+ savedLang = parsed.state?.language
+ } catch {
+ savedLang = savedStorage
+ }
+}
+
const defaultLang: SupportedLanguage =
SUPPORTED_LANGUAGES.includes(savedLang as SupportedLanguage) ? (savedLang as SupportedLanguage) : 'en'
diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json
index 89f7ac9..8228968 100644
--- a/src/lib/i18n/locales/en.json
+++ b/src/lib/i18n/locales/en.json
@@ -131,13 +131,16 @@
"Loading": "Loading",
"Loan": "Loan",
"Loan Card": "Loan Card",
+ "Cancel": "Cancel",
"Loan department": "Loan department",
"Loan order": "Loan order",
+ "New Loan Order": "New Loan Order",
"Loan order created": "Loan order created",
"Loan order deleted": "Loan order deleted",
"Loan order required docs": "Loan order required docs",
"Loan order updated": "Loan order updated",
"Loan orders": "Loan orders",
+ "Loan order (Mobile)": "Loan order (Mobile)",
"Loan type": "Loan type",
"Loan types": "Loan types",
"Locale": "Locale",
@@ -355,5 +358,54 @@
"You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account.",
"Your password has been updated": "Your password has been updated",
"Enter your username to continue": "Enter your username to continue",
- "Old surname (if changed)": "Old surname (if changed)"
+ "Old surname (if changed)": "Old surname (if changed)",
+ "common.view": "View",
+ "common.edit": "Edit",
+ "common.delete": "Delete",
+ "common.search": "Search",
+ "common.yes": "Yes",
+ "common.no": "No",
+ "loanOrderMobiles.title": "Loan Orders (Mobile)",
+ "loanOrderMobiles.searchPlaceholder": "Search...",
+ "loanOrderMobiles.createButton": "Create Loan Order",
+ "loanOrderMobiles.deleteConfirm": "Are you sure you want to delete this order?",
+ "loanOrderMobiles.columns.id": "ID",
+ "loanOrderMobiles.columns.loanType": "LOAN TYPE",
+ "loanOrderMobiles.columns.createdAt": "CREATED AT",
+ "loanOrderMobiles.columns.region": "REGION",
+ "loanOrderMobiles.columns.branch": "BRANCH",
+ "loanOrderMobiles.columns.firstName": "FIRST NAME",
+ "loanOrderMobiles.columns.lastName": "LAST NAME",
+ "loanOrderMobiles.columns.phone": "PHONE",
+ "loanOrderMobiles.columns.status": "STATUS",
+ "loanOrderMobiles.filters.region": "REGION",
+ "loanOrderMobiles.filters.status": "STATUS",
+ "loanOrderMobiles.filters.branch": "BRANCH",
+ "loanOrderMobiles.filters.archived": "ARCHIVED",
+ "loanPaidOffLetters.title": "Loan Paid Off Letters",
+ "loanPaidOffLetters.emptyMessage": "No records found matching the criteria.",
+ "loanPaidOffLetters.createButton": "Create Paid Off Letter",
+ "loanPaidOffLetters.deleteConfirm": "Are you sure you want to delete this record?",
+ "loanPaidOffLetters.columns.id": "ID",
+ "loanPaidOffLetters.columns.passportSeries": "PASSPORT SERIES",
+ "loanPaidOffLetters.columns.passportNumber": "PASSPORT NUMBER",
+ "loanPaidOffLetters.columns.loanAccount": "LOAN ACCOUNT",
+ "loanPaidOffLetters.columns.issuedAt": "ISSUED AT",
+ "loanRemaining.title": "Loan Remaining Balance",
+ "loanRemaining.createButton": "Create Loan Remaining Record",
+ "loanRemaining.deleteConfirm": "Are you sure you want to delete this record?",
+ "loanRemaining.columns.id": "ID",
+ "loanRemaining.columns.passportSeries": "PASSPORT SERIES",
+ "loanRemaining.columns.passportNumber": "PASSPORT NUMBER",
+ "loanRemaining.columns.loanAccount": "LOAN ACCOUNT",
+ "loanOrderStatus.GARAŞYLÝAR": "PENDING",
+ "loanOrderStatus.KANAGATLANDYRYLAN": "APPROVED",
+ "loanOrderStatus.RED_EDILDI": "REJECTED",
+ "loanOrderStatus.IŞLENÝÄR": "PROCESSING",
+ "Dashboards": "Dashboard",
+ "Card Issuance Reasons": "Card Issuance Reasons",
+ "Locale Manager": "Locale Manager",
+ "Resources": "Resources",
+ "Currency rates": "Currency rates",
+ "Loan balance": "Loan balance"
}
\ No newline at end of file
diff --git a/src/lib/i18n/locales/ru.json b/src/lib/i18n/locales/ru.json
index 0d4e1b6..05ce236 100644
--- a/src/lib/i18n/locales/ru.json
+++ b/src/lib/i18n/locales/ru.json
@@ -31,6 +31,7 @@
"Branches": "Филиалы",
"Cancelled": "Отменено",
"Card": "Карта",
+ "Cancel": "Отменить",
"Card balance": "Баланс карты",
"Card balances": "Балансы карт",
"Card department": "Карточный отдел",
@@ -133,11 +134,13 @@
"Loan Card": "Кредитная карта",
"Loan department": "Кредитный отдел",
"Loan order": "Заявка на кредит",
+ "New Loan Order": "Новая заявка на кредит",
"Loan order created": "Заявка на кредит создана",
"Loan order deleted": "Заявка на кредит удалена",
"Loan order required docs": "Необходимые документы для кредита",
"Loan order updated": "Заявка на кредит обновлена",
"Loan orders": "Заявки на кредит",
+ "Loan order (Mobile)": "Заявка на кредит (Мобильный)",
"Loan type": "Тип кредита",
"Loan types": "Типы кредитов",
"Locale": "Языковой стандарт",
@@ -355,5 +358,54 @@
"You are receiving this email because we received a password reset request for your account.": "Вы получили это письмо, потому что мы получили запрос на сброс пароля для Вашей учётной записи.",
"Your password has been updated": "Ваш пароль был обновлён",
"Enter your username to continue": "Введите свое имя пользователя, чтобы продолжить",
- "Old surname (if changed)": "Старая фамилия (если менялась)"
+ "Old surname (if changed)": "Старая фамилия (если менялась)",
+ "common.view": "Просмотр",
+ "common.edit": "Редактировать",
+ "common.delete": "Удалить",
+ "common.search": "Поиск",
+ "common.yes": "Да",
+ "common.no": "Нет",
+ "loanOrderMobiles.title": "Заявки на кредит (Мобильные)",
+ "loanOrderMobiles.searchPlaceholder": "Поиск...",
+ "loanOrderMobiles.createButton": "Создать заявку на кредит",
+ "loanOrderMobiles.deleteConfirm": "Вы уверены, что хотите удалить этот заказ?",
+ "loanOrderMobiles.columns.id": "ID",
+ "loanOrderMobiles.columns.loanType": "ТИП КРЕДИТА",
+ "loanOrderMobiles.columns.createdAt": "ДАТА СОЗДАНИЯ",
+ "loanOrderMobiles.columns.region": "ВЕЛАЯТ",
+ "loanOrderMobiles.columns.branch": "ФИЛИАЛ",
+ "loanOrderMobiles.columns.firstName": "ИМЯ",
+ "loanOrderMobiles.columns.lastName": "ФАМИЛИЯ",
+ "loanOrderMobiles.columns.phone": "ТЕЛЕФОН",
+ "loanOrderMobiles.columns.status": "СТАТУС",
+ "loanOrderMobiles.filters.region": "ВЕЛАЯТ",
+ "loanOrderMobiles.filters.status": "СТАТУС",
+ "loanOrderMobiles.filters.branch": "ФИЛИАЛ",
+ "loanOrderMobiles.filters.archived": "АРХИВИРОВАНО",
+ "loanPaidOffLetters.title": "Справки о погашении кредита",
+ "loanPaidOffLetters.emptyMessage": "Справки о погашении кредита не найдены.",
+ "loanPaidOffLetters.createButton": "Создать справку о погашении",
+ "loanPaidOffLetters.deleteConfirm": "Вы уверены, что хотите удалить эту запись?",
+ "loanPaidOffLetters.columns.id": "ID",
+ "loanPaidOffLetters.columns.passportSeries": "СЕРИЯ ПАСПОРТА",
+ "loanPaidOffLetters.columns.passportNumber": "НОМЕР ПАСПОРТА",
+ "loanPaidOffLetters.columns.loanAccount": "КРЕДИТНЫЙ СЧЕТ",
+ "loanPaidOffLetters.columns.issuedAt": "ДАТА ВЫДАЧИ",
+ "loanRemaining.title": "Остаток кредита",
+ "loanRemaining.createButton": "Создать запись об остатке кредита",
+ "loanRemaining.deleteConfirm": "Вы уверены, что хотите удалить эту запись?",
+ "loanRemaining.columns.id": "ID",
+ "loanRemaining.columns.passportSeries": "СЕРИЯ ПАСПОРТА",
+ "loanRemaining.columns.passportNumber": "НОМЕР ПАСПОРТА",
+ "loanRemaining.columns.loanAccount": "КРЕДИТНЫЙ СЧЕТ",
+ "loanOrderStatus.GARAŞYLÝAR": "В ОЖИДАНИИ",
+ "loanOrderStatus.KANAGATLANDYRYLAN": "ОДОБРЕНО",
+ "loanOrderStatus.RED_EDILDI": "ОТКЛОНЕНО",
+ "loanOrderStatus.IŞLENÝÄR": "В ПРОЦЕССЕ",
+ "Dashboards": "Панели управления",
+ "Card Issuance Reasons": "Причины выдачи карты",
+ "Locale Manager": "Управление локалью",
+ "Resources": "Ресурсы",
+ "Currency rates": "Курсы валют",
+ "Loan balance": "Остаток кредита"
}
\ No newline at end of file
diff --git a/src/lib/i18n/locales/tk.json b/src/lib/i18n/locales/tk.json
index d9934c6..47f843b 100644
--- a/src/lib/i18n/locales/tk.json
+++ b/src/lib/i18n/locales/tk.json
@@ -31,6 +31,7 @@
"Branches": "Şahamçalar",
"Cancelled": "Ýatyrylan",
"Card": "Kart",
+ "Cancel": "Ýatyrmak",
"Card balance": "Kart galyndysy",
"Card balances": "Kart galyndylary",
"Card department": "Kart bölümi",
@@ -133,11 +134,13 @@
"Loan Card": "Karz karty",
"Loan department": "Karz bölümi",
"Loan order": "Karz sargyt",
+ "New Loan Order": "Täze Karz Sargyt",
"Loan order created": "Karz sargydy döredildi",
"Loan order deleted": "Karz sargydy pozuldy",
"Loan order required docs": "Karz gerekli resminamalary",
"Loan order updated": "Karz sargydy üýtgedildi",
"Loan orders": "Karz sargytlary",
+ "Loan order (Mobile)": "Karz sargyt (Mobil)",
"Loan type": "Karz görnüşi",
"Loan types": "Karz görnüşleri",
"Locale": "Dil",
@@ -355,5 +358,55 @@
"You are receiving this email because we received a password reset request for your account.": "Bu e-poçta alýarsyňyz, sebäbi hasabyňyz üçin paroly täzeden düzmek haýyşyny aldyk.",
"Your password has been updated": "Siziň açar sözüňiz üýtgedildi",
"Enter your username to continue": "Dowam etmek üçin ulanyjy adyny giriziň",
- "Old surname (if changed)": "Köne familiýaňyz (eger üýtgän bolsa)"
+ "Old surname (if changed)": "Köne familiýaňyz (eger üýtgän bolsa)",
+ "common.view": "Görmek",
+ "common.edit": "Üýtgetmek",
+ "common.delete": "Pozmak",
+ "common.search": "Gözlemek",
+ "common.yes": "Hawa",
+ "common.no": "Ýok",
+ "loanOrderMobiles.title": "Karz sargytlary",
+ "loanOrderMobiles.searchPlaceholder": "Gözlemek",
+ "loanOrderMobiles.createButton": "Karz sargyt dörediň",
+ "loanOrderMobiles.deleteConfirm": "Bu sargyt pozulsynmy?",
+ "loanOrderMobiles.columns.id": "ID",
+ "loanOrderMobiles.columns.loanType": "KARZ GÖRNÜŞI",
+ "loanOrderMobiles.columns.createdAt": "DÖREDILEN WAGTY",
+ "loanOrderMobiles.columns.region": "WELAÝAT",
+ "loanOrderMobiles.columns.branch": "ŞAHAMÇA",
+ "loanOrderMobiles.columns.firstName": "ADY",
+ "loanOrderMobiles.columns.lastName": "FAMILIÝASY",
+ "loanOrderMobiles.columns.phone": "TELEFON",
+ "loanOrderMobiles.columns.status": "STATUS",
+ "loanOrderMobiles.filters.region": "WELAÝAT",
+ "loanOrderMobiles.filters.status": "STATUS",
+ "loanOrderMobiles.filters.branch": "ŞAHAMÇA",
+ "loanOrderMobiles.filters.archived": "ARHIWLENEN",
+ "loanPaidOffLetters.title": "Karzyň ýapylandygy barada güwanamalar",
+ "loanPaidOffLetters.emptyMessage": "Berlen kriteriýalara Karzyň ýapylandygy barada güwanama almak gabat gelmedi.",
+ "loanPaidOffLetters.createButton": "Karzyň ýapylandygy barada güwanama almak dörediň",
+ "loanPaidOffLetters.deleteConfirm": "Bu ýazgy pozulsynmy?",
+ "loanPaidOffLetters.columns.id": "ID",
+ "loanPaidOffLetters.columns.passportSeries": "PASPORT SERIÝASY",
+ "loanPaidOffLetters.columns.passportNumber": "PASPORT BELGISI",
+ "loanPaidOffLetters.columns.loanAccount": "KARZ HASABY",
+ "loanPaidOffLetters.columns.issuedAt": "BERLEN WAGTY",
+ "loanRemaining.title": "Karzyň galyndysy",
+ "loanRemaining.createButton": "Karzyň galyndysy dörediň",
+ "loanRemaining.deleteConfirm": "Bu ýazgy pozulsynmy?",
+ "loanRemaining.columns.id": "ID",
+ "loanRemaining.columns.passportSeries": "PASPORT SERIÝASY",
+ "loanRemaining.columns.passportNumber": "PASPORT BELGISI",
+ "loanRemaining.columns.loanAccount": "KARZ HASABY",
+ "loanOrderStatus.GARAŞYLÝAR": "GARAŞYLÝAR",
+ "loanOrderStatus.KANAGATLANDYRYLAN": "KANAGATLANDYRYLAN",
+ "loanOrderStatus.RED_EDILDI": "RED EDILDI",
+ "loanOrderStatus.IŞLENÝÄR": "IŞLENÝÄR",
+ "Dashboards": "Dolandyryş panelleri",
+"Card Issuance Reasons": "Kartyň çykarylmagynyň sebäpleri",
+"Locale Manager": "Locale dolandyryjy",
+"Resources": "Çeşmeler",
+"Currency rates": "Walýuta kurslary",
+"Loan balance": "Karzyň galyndysy"
+
}
\ No newline at end of file
diff --git a/src/main.tsx b/src/main.tsx
index 24a5bba..074dd38 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,5 +1,6 @@
import { createRoot } from 'react-dom/client'
import { QueryProvider } from '@/app/providers/QueryProvider'
+import { Toaster } from '@/components/ui/sonner'
import '@/lib/i18n'
import './index.css'
import App from './App.tsx'
@@ -7,5 +8,6 @@ import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
+
)
diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx
index 43188e7..bd3b400 100644
--- a/src/pages/dashboard/index.tsx
+++ b/src/pages/dashboard/index.tsx
@@ -13,7 +13,7 @@ export default function DashboardPage() {
-
+
{t('Loan orders (all)', 'Karz sargytlary (ählisi)')}
30 gün
@@ -30,7 +30,7 @@ export default function DashboardPage() {
-
+
{t('Loan orders (all)', 'Karz sargytlary (ählisi)')}
30 gün
@@ -48,7 +48,7 @@ export default function DashboardPage() {
-
+
{t('Loan orders (all)', 'Karz sargytlary (ählisi)')}
(6,968 jemi)
diff --git a/src/pages/loanOrderCreate/index.tsx b/src/pages/loanOrderCreate/index.tsx
new file mode 100644
index 0000000..c84f0dd
--- /dev/null
+++ b/src/pages/loanOrderCreate/index.tsx
@@ -0,0 +1,733 @@
+import { useState, useCallback } from 'react'
+import { useNavigate } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { toast } from 'sonner'
+import { FormInput } from '@/components/formInput'
+import { Button } from '@/components/ui/button'
+import { useCreateLoanOrder } from '@/features/loanOrders/hooks/useLoanOrders'
+import type { LoanOrderCreatePayload } from '@/features/loanOrders/api/loanOrdersApi'
+import { cn } from '@/lib/utils'
+
+// ─── Section Wrapper ──────────────────────────────────────────────────────────
+
+function Section({ title, children, className }: {
+ title: string
+ children: React.ReactNode
+ className?: string
+}) {
+ return (
+
+
+
{title}
+
+
{children}
+
+ )
+}
+
+// ─── Grid helpers ─────────────────────────────────────────────────────────────
+
+const grid2 = 'grid grid-cols-1 sm:grid-cols-2 gap-6'
+const grid3 = 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6'
+const grid4 = 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6'
+
+// ─── Static options ───────────────────────────────────────────────────────────
+
+const REGION_OPTIONS = [
+ { value: 'Aşgabat', label: 'Aşgabat' },
+ { value: 'Ahal', label: 'Ahal' },
+ { value: 'Balkan', label: 'Balkan' },
+ { value: 'Daşoguz', label: 'Daşoguz' },
+ { value: 'Lebap', label: 'Lebap' },
+ { value: 'Mary', label: 'Mary' },
+ { value: 'Arkadag', label: 'Arkadag' },
+]
+
+const EDUCATION_OPTIONS = [
+ { 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' },
+]
+
+const MARRIAGE_OPTIONS = [
+ { 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' },
+]
+
+const STATUS_OPTIONS = [
+ { value: 'GARAŞYLÝAR', label: 'Garaşylýar' },
+ { value: 'IŞLENÝÄR', label: 'Işlenýär' },
+ { value: 'KANAGATLANDYRYLAN', label: 'Kanagatlandyrylan' },
+ { value: 'RED_EDILDI', label: 'Red edildi' },
+]
+
+const LOAN_TYPE_OPTIONS = [
+ { value: 'consumer', label: 'Sarp ediş karzy' },
+ { value: 'mortgage', label: 'Ipoteka' },
+ { value: 'car', label: 'Awtoulag karzy' },
+ { value: 'student', label: 'Talyplar üçin' },
+ { value: 'business', label: 'Işewürlik karzy' },
+]
+
+const PASSPORT_SERIES_OPTIONS = [
+ { value: 'I', label: 'I' },
+ { value: 'II', label: 'II' },
+]
+
+// ─── Form State Types ─────────────────────────────────────────────────────────
+
+interface FormState {
+ // Status & unique
+ status: string
+ uniqueCode: string
+ // Loan
+ loanType: string
+ // Location
+ region: string
+ branch: string
+ // Personal
+ firstName: string
+ lastName: string
+ patronicName: string
+ education: string
+ marriageStatus: string
+ dateOfBirth: string
+ residence: string
+ currentResidence: string
+ // Passport
+ passportSerie: string
+ passportNumber: string
+ passportDateOfIssue: string
+ passportGivenBy: string
+ bornPlace: string
+ // Contact
+ email: string
+ phone: string
+ phoneAdditional: string
+ homePhone: string
+ // Job
+ workCompany: string
+ workHrPhone: string
+ workRegion: string
+ workProvince: string
+ position: string
+ salary: string
+ workStartedAt: string
+ // Files
+ passportPage1: File | null
+ passportPage23: File | null
+ passportPage89: File | null
+ passportPage32: File | null
+}
+
+type FormErrors = Partial
>
+
+const INITIAL_STATE: FormState = {
+ status: 'GARAŞYLÝAR',
+ uniqueCode: '',
+ loanType: '',
+ region: 'Aşgabat',
+ branch: '',
+ firstName: '',
+ lastName: '',
+ patronicName: '',
+ education: '',
+ marriageStatus: '',
+ dateOfBirth: '',
+ residence: '',
+ currentResidence: '',
+ passportSerie: '',
+ passportNumber: '',
+ passportDateOfIssue: '',
+ passportGivenBy: '',
+ bornPlace: '',
+ email: '',
+ phone: '',
+ phoneAdditional: '',
+ homePhone: '',
+ workCompany: '',
+ workHrPhone: '',
+ workRegion: 'Aşgabat',
+ workProvince: '',
+ position: '',
+ salary: '',
+ workStartedAt: '',
+ passportPage1: null,
+ passportPage23: null,
+ passportPage89: null,
+ passportPage32: null,
+}
+
+// ─── Validation ───────────────────────────────────────────────────────────────
+
+function validate(form: FormState, t: (k: string) => string): FormErrors {
+ const errors: FormErrors = {}
+ const req = (key: keyof FormState, label: string) => {
+ const val = form[key]
+ if (!val || (typeof val === 'string' && !val.trim())) {
+ errors[key] = `${label} — ${t('required') || 'hökmany'}`
+ }
+ }
+
+ req('loanType', t('Loan type') || 'Karz görnüşi')
+ req('region', t('Region') || 'Welaýat')
+ req('branch', t('Branch') || 'Şahamça')
+ req('firstName', t('Name') || 'Ady')
+ req('lastName', t('Surname') || 'Familiýasy')
+ req('education', t('Education') || 'Bilimi')
+ req('marriageStatus', t('Marriage status') || 'Maşgala ýagdaýy')
+ req('dateOfBirth', t('Date of birth') || 'Doglan güni')
+ req('residence', t('Residence (passport)') || 'Ýazgy edilen salgy')
+ req('passportSerie', t('Passport serie') || 'Pasport seriýasy')
+ req('passportNumber', t('Passport number') || 'Pasport belgisi')
+ req('passportDateOfIssue', t('Passport date of issue') || 'Pasport berlen senesi')
+ req('passportGivenBy', t('Passport given by') || 'Kim tarapyndan berildi')
+ req('phone', t('Phone') || 'Telefon')
+ req('workCompany', t('Work company name') || 'Kärhananyň ady')
+ req('position', t('Position') || 'Wezipe')
+ req('salary', t('Salary') || 'Zähmet haky')
+ req('workStartedAt', t('Work started at') || 'Işe başlan wagty')
+
+ if (form.phone && form.phone.replace(/\D/g, '').length < 8) {
+ errors.phone = 'Telefon belgisi nädogry'
+ }
+
+ if (!form.passportPage1) errors.passportPage1 = 'Pasport (sahypa 1) hökmany'
+ if (!form.passportPage23) errors.passportPage23 = 'Pasport (sahypa 2-3) hökmany'
+
+ return errors
+}
+
+// ─── Page ─────────────────────────────────────────────────────────────────────
+
+export default function LoanOrderCreatePage() {
+ const { t } = useTranslation()
+ const navigate = useNavigate()
+ const createMutation = useCreateLoanOrder()
+
+ const [form, setForm] = useState(INITIAL_STATE)
+ const [errors, setErrors] = useState({})
+ const [submitted, setSubmitted] = useState(false)
+
+ // Generic field updater
+ const set = useCallback((key: K, value: FormState[K]) => {
+ setForm((prev) => ({ ...prev, [key]: value }))
+ // Clear error on change
+ if (submitted) {
+ setErrors((prev) => ({ ...prev, [key]: undefined }))
+ }
+ }, [submitted])
+
+ const handleSubmit = () => {
+ setSubmitted(true)
+ const errs = validate(form, t)
+ if (Object.keys(errs).length > 0) {
+ setErrors(errs)
+ toast.error(t('Write a correct data please') || 'Dogry maglumat girizmegiňizi haýyş edýäris.')
+ // scroll to first error
+ const firstErrorKey = Object.keys(errs)[0]
+ document.getElementById(`field-${firstErrorKey}`)?.scrollIntoView({ behavior: 'smooth', block: 'center' })
+ return
+ }
+
+ const payload: LoanOrderCreatePayload = {
+ status: form.status,
+ loanType: form.loanType,
+ region: form.region,
+ branch: form.branch,
+ firstName: form.firstName,
+ lastName: form.lastName,
+ patronicName: form.patronicName,
+ education: form.education,
+ marriageStatus: form.marriageStatus,
+ dateOfBirth: form.dateOfBirth,
+ residence: form.residence,
+ currentResidence: form.currentResidence,
+ passportSerie: form.passportSerie,
+ passportNumber: form.passportNumber,
+ passportDateOfIssue: form.passportDateOfIssue,
+ passportGivenBy: form.passportGivenBy,
+ bornPlace: form.bornPlace,
+ email: form.email,
+ phone: form.phone,
+ phoneAdditional: form.phoneAdditional,
+ homePhone: form.homePhone,
+ workCompany: form.workCompany,
+ workHrPhone: form.workHrPhone,
+ workRegion: form.workRegion,
+ workProvince: form.workProvince,
+ position: form.position,
+ salary: Number(form.salary),
+ workStartedAt: form.workStartedAt,
+ }
+
+ createMutation.mutate(payload, {
+ onSuccess: () => {
+ toast.success(t('Loan order created') || 'Karz sargydy döredildi')
+ navigate('/resources/loan-orders')
+ },
+ onError: () => {
+ toast.error(t('Server Error') || 'Serwer ýalňyşlygy')
+ },
+ })
+ }
+
+ // ── Render ────────────────────────────────────────────────────────────────
+ return (
+
+
+ {/* Page title */}
+
+
+ {t('Loan order') || 'Karz sargyt döredüň'}
+
+
+
+ {/* ── Status & Unique ──────────────────────────────────────────────── */}
+
+
+
+ set('status', v)}
+ options={STATUS_OPTIONS}
+ error={errors.status}
+ placeholder="Saýlaň"
+ />
+
+
+ set('uniqueCode', v)}
+ placeholder={t('Unique code') || 'Bellik'}
+ error={errors.uniqueCode}
+ />
+
+
+
+
+ {/* ── Loan Type ────────────────────────────────────────────────────── */}
+
+
+ set('loanType', v)}
+ options={LOAN_TYPE_OPTIONS}
+ placeholder="Saýlamak üçin basyň"
+ error={errors.loanType}
+ />
+
+
+
+ {/* ── Location ─────────────────────────────────────────────────────── */}
+
+
+
+ set('region', v)}
+ options={REGION_OPTIONS}
+ placeholder="Saýlamak üçin basyň"
+ error={errors.region}
+ />
+
+
+ set('branch', v)}
+ options={[]}
+ placeholder="Saýlamak üçin basyň"
+ error={errors.branch}
+ />
+
+
+
+
+ {/* ── Personal Data ─────────────────────────────────────────────────── */}
+
+
+
+
+ set('firstName', v)}
+ placeholder={t('Name') || 'Ady'}
+ error={errors.firstName}
+ />
+
+
+ set('lastName', v)}
+ placeholder={t('Surname') || 'Familiýasy'}
+ error={errors.lastName}
+ />
+
+
+ set('patronicName', v)}
+ placeholder={t('Patronic name') || 'Atasynyň ady'}
+ />
+
+
+
+
+
+ set('education', v)}
+ options={EDUCATION_OPTIONS}
+ placeholder="Saýlaň"
+ error={errors.education}
+ />
+
+
+ set('marriageStatus', v)}
+ options={MARRIAGE_OPTIONS}
+ placeholder="Saýlaň"
+ error={errors.marriageStatus}
+ />
+
+
+ set('dateOfBirth', v)}
+ error={errors.dateOfBirth}
+ />
+
+
+
+
+
+ set('residence', v)}
+ placeholder={t('Residence (passport)') || 'Ýazgy edilen salgyňyz'}
+ error={errors.residence}
+ />
+
+
+ set('currentResidence', v)}
+ placeholder={t('Current Residence') || 'Häzirki ýaşaýyş ýeri'}
+ />
+
+
+
+
+
+ {/* ── Passport ──────────────────────────────────────────────────────── */}
+
+
+
+
+ set('passportSerie', v)}
+ options={PASSPORT_SERIES_OPTIONS}
+ placeholder="Saýlamak üçin basyň"
+ error={errors.passportSerie}
+ />
+
+
+ set('passportNumber', v)}
+ placeholder={t('Passport number') || 'Pasport belgisi'}
+ error={errors.passportNumber}
+ />
+
+
+ set('passportDateOfIssue', v)}
+ error={errors.passportDateOfIssue}
+ />
+
+
+
+
+
+ set('passportGivenBy', v)}
+ placeholder={t('Passport given by') || 'Kim tarapyndan berildi'}
+ error={errors.passportGivenBy}
+ />
+
+
+ set('bornPlace', v)}
+ placeholder={t('Born place (passport)') || 'Doglan ýeri (pasport)'}
+ />
+
+
+
+
+
+ {/* ── Contact ───────────────────────────────────────────────────────── */}
+
+
+
+ set('email', v)}
+ placeholder="E-poçta"
+ />
+
+
+ set('phone', v)}
+ placeholder="61 097 651"
+ error={errors.phone}
+ />
+
+
+ set('phoneAdditional', v)}
+ placeholder="61 097 651"
+ />
+
+
+ set('homePhone', v)}
+ placeholder="61 097 651"
+ />
+
+
+
+
+ {/* ── Job ───────────────────────────────────────────────────────────── */}
+
+
+
+
+ set('workCompany', v)}
+ placeholder={t('Work company name') || 'Işleýän edaranyň/kärhananyň ady'}
+ error={errors.workCompany}
+ />
+
+
+ set('workHrPhone', v)}
+ placeholder="61 097 651"
+ />
+
+
+
+
+
+ set('workRegion', v)}
+ options={REGION_OPTIONS}
+ placeholder="Saýlamak üçin basyň"
+ />
+
+
+ set('workProvince', v)}
+ options={[]}
+ placeholder="Saýlamak üçin basyň"
+ />
+
+
+
+
+
+ set('position', v)}
+ placeholder={t('Position') || 'Wezipe'}
+ error={errors.position}
+ />
+
+
+ set('salary', v)}
+ placeholder={t('Salary') || 'Zähmet haky'}
+ error={errors.salary}
+ />
+
+
+ set('workStartedAt', v)}
+ error={errors.workStartedAt}
+ />
+
+
+
+
+
+ {/* ── Passport Files ────────────────────────────────────────────────── */}
+
+
+
+ set('passportPage1', f)}
+ placeholder="Faýl saýlaň ýa-da salmak üçin basyň"
+ error={errors.passportPage1}
+ />
+
+
+ set('passportPage23', f)}
+ placeholder="Faýl saýlaň ýa-da salmak üçin basyň"
+ error={errors.passportPage23}
+ />
+
+
+ set('passportPage89', f)}
+ placeholder="Faýl saýlaň ýa-da salmak üçin basyň"
+ />
+
+
+ set('passportPage32', f)}
+ placeholder="Faýl saýlaň ýa-da salmak üçin basyň"
+ />
+
+
+
+
+ {/* ── Footer Actions ────────────────────────────────────────────────── */}
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/loanOrderMobiles/index.tsx b/src/pages/loanOrderMobiles/index.tsx
index b9cdecf..9975455 100644
--- a/src/pages/loanOrderMobiles/index.tsx
+++ b/src/pages/loanOrderMobiles/index.tsx
@@ -28,21 +28,9 @@ const COLUMN_IDS = [
// ─── Filter options ────────────────────────────────────────────────────────────
-const REGION_OPTIONS = [
- { value: 'Balkan', label: 'Balkan' },
- { value: 'Ahal', label: 'Ahal' },
- { value: 'Daşoguz', label: 'Daşoguz' },
- { value: 'Lebap', label: 'Lebap' },
- { value: 'Mary', label: 'Mary' },
- { value: 'Aşgabat', label: 'Aşgabat' },
-]
-
-const STATUS_OPTIONS: { value: LoanOrderMobileStatus; label: string }[] = [
- { value: 'GARAŞYLÝAR', label: 'GARAŞYLÝAR' },
- { value: 'KANAGATLANDYRYLAN', label: 'KANAGATLANDYRYLAN' },
- { value: 'RED_EDILDI', label: 'RED EDILDI' },
- { value: 'IŞLENÝÄR', label: 'IŞLENÝÄR' },
-]
+// ─── Filter options (Internal keys/values) ───────────────────────────────────
+const REGION_OPTIONS = ['Balkan', 'Ahal', 'Daşoguz', 'Lebap', 'Mary', 'Aşgabat']
+const STATUS_OPTIONS: LoanOrderMobileStatus[] = ['GARAŞYLÝAR', 'KANAGATLANDYRYLAN', 'RED_EDILDI', 'IŞLENÝÄR']
// ─── Page Component ────────────────────────────────────────────────────────────
@@ -105,7 +93,7 @@ export default function LoanOrderMobilesPage() {
{
id: 'id',
accessorKey: 'id',
- header: t('ID', 'ID'),
+ header: t('loanOrderMobiles.columns.id', 'ID'),
cell: ({ row }) => (
{row.original.id}
),
@@ -189,13 +177,13 @@ export default function LoanOrderMobilesPage() {
cell: ({ row }) => (