added missin lang keys
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useMemo, useState } from "react";
|
||||
import { Download, Eye, ChevronDown } from "lucide-react";
|
||||
import { Download, Eye, ChevronDown, Inbox } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
@@ -273,7 +273,7 @@ export function useAuditColumns(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: "ID",
|
||||
header: t("audit.columns.id", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-xs font-mono text-muted-foreground">
|
||||
{row.original.id}
|
||||
@@ -355,6 +355,25 @@ export interface AuditLogProps {
|
||||
onView?: (log: AuditRowProps) => void;
|
||||
}
|
||||
|
||||
// ─── EmptyState ────────────────────────────────────────────────────────────────
|
||||
|
||||
export interface EmptyStateProps {
|
||||
label: string;
|
||||
}
|
||||
|
||||
export function EmptyState({ label }: EmptyStateProps) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center py-12 gap-4">
|
||||
<div className="w-16 h-16 rounded-full bg-muted flex items-center justify-center">
|
||||
<Inbox size={32} className="text-muted-foreground" />
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground text-center">{label}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── AuditLog ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export function AuditLog({
|
||||
logs,
|
||||
currentPage,
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Building2, MapPin, Clock } from 'lucide-react'
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
import { FormInput } from '@/components/formInput'
|
||||
import { FormActions } from '@/components/formActions'
|
||||
import { MultiLangInput } from '@/components/multiLangInput'
|
||||
import { Checkbox } from '@/components/ui/checkbox'
|
||||
import { StepBarCards, type StepCardItem } from '@/components/stepBarV2'
|
||||
import { useCreateBranch, useUpdateBranch } from '@/features/branches/hooks/useBranches'
|
||||
@@ -27,14 +28,6 @@ function flattenErrors(errors: Record<string, { message?: string } | undefined>)
|
||||
return result
|
||||
}
|
||||
|
||||
type LangKey = 'tk' | 'ru' | 'en'
|
||||
|
||||
const LANG_TABS: { key: LangKey; label: string }[] = [
|
||||
{ key: 'tk', label: 'Türkmen' },
|
||||
{ key: 'ru', label: 'Русский' },
|
||||
{ key: 'en', label: 'English' },
|
||||
]
|
||||
|
||||
interface StepDef {
|
||||
id: string
|
||||
titleKey: string
|
||||
@@ -85,46 +78,25 @@ interface StepContentProps {
|
||||
form: BranchFormData
|
||||
errors: FlatErrors
|
||||
set: <K extends keyof BranchFormData>(k: K, v: BranchFormData[K]) => void
|
||||
activeLang: LangKey
|
||||
setActiveLang: (l: LangKey) => void
|
||||
t: (key: string, fallback?: string) => string
|
||||
lang: 'tk' | 'ru' | 'en'
|
||||
}
|
||||
|
||||
function StepBasic({ form, errors, set, activeLang, setActiveLang }: StepContentProps) {
|
||||
const nameFieldKey = `name${activeLang.charAt(0).toUpperCase() + activeLang.slice(1)}` as 'nameTk' | 'nameRu' | 'nameEn'
|
||||
const nameErrorKey = nameFieldKey as keyof FlatErrors
|
||||
function StepBasic({ form, errors, set, t, lang }: StepContentProps) {
|
||||
const nameFields = {
|
||||
tk: { value: form.nameTk, onChange: (v: string) => set('nameTk', v), error: errors.nameTk },
|
||||
ru: { value: form.nameRu, onChange: (v: string) => set('nameRu', v), error: errors.nameRu },
|
||||
en: { value: form.nameEn, onChange: (v: string) => set('nameEn', v), error: errors.nameEn },
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="flex gap-3 justify-end mb-2">
|
||||
{LANG_TABS.map((tab) => (
|
||||
<button
|
||||
key={tab.key}
|
||||
type="button"
|
||||
onClick={() => setActiveLang(tab.key)}
|
||||
className={`text-sm transition-colors ${
|
||||
activeLang === tab.key
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground hover:text-foreground'
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<MultiLangInput fields={nameFields} placeholder={t('branches.fields.name', 'Şahamçanyň ady')} />
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
||||
<FormInput
|
||||
type="text"
|
||||
label="Şahamçanyň ady"
|
||||
required
|
||||
value={form[nameFieldKey]}
|
||||
onChange={(v) => set(nameFieldKey, v)}
|
||||
placeholder="Şahamçanyň ady"
|
||||
error={errors[nameErrorKey]}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
label="Kod"
|
||||
label={t('branches.fields.code', 'Kod')}
|
||||
required
|
||||
value={form.code}
|
||||
onChange={(v) => set('code', v)}
|
||||
@@ -136,12 +108,12 @@ function StepBasic({ form, errors, set, activeLang, setActiveLang }: StepContent
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
||||
<FormInput
|
||||
type="searchable-select"
|
||||
label="Etrap"
|
||||
label={t('branches.fields.district', 'Etrap')}
|
||||
required
|
||||
value={form.districtId}
|
||||
onChange={(v) => set('districtId', v)}
|
||||
options={getDistrictOptions().map((d) => ({ value: String(d.id), label: d.name.tk }))}
|
||||
placeholder="Etrap saýlaň"
|
||||
options={getDistrictOptions().map((d) => ({ value: String(d.id), label: d.name[lang] }))}
|
||||
placeholder={t('branches.fields.district', 'Etrap saýlaň')}
|
||||
error={errors.districtId}
|
||||
/>
|
||||
<div className="flex items-end pb-2">
|
||||
@@ -152,7 +124,7 @@ function StepBasic({ form, errors, set, activeLang, setActiveLang }: StepContent
|
||||
onCheckedChange={(checked) => set('isActive', !!checked)}
|
||||
/>
|
||||
<label htmlFor="isActive" className="text-sm text-muted-foreground cursor-pointer select-none">
|
||||
Işjeň
|
||||
{t('branches.fields.isActive', 'Işjeň')}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,43 +133,21 @@ function StepBasic({ form, errors, set, activeLang, setActiveLang }: StepContent
|
||||
)
|
||||
}
|
||||
|
||||
function StepAddress({ form, errors, set, activeLang, setActiveLang }: StepContentProps) {
|
||||
const addrFieldKey = `address${activeLang.charAt(0).toUpperCase() + activeLang.slice(1)}` as 'addressTk' | 'addressRu' | 'addressEn'
|
||||
const addrErrorKey = addrFieldKey as keyof FlatErrors
|
||||
function StepAddress({ form, errors, set, t }: StepContentProps) {
|
||||
const addressFields = {
|
||||
tk: { value: form.addressTk, onChange: (v: string) => set('addressTk', v), error: errors.addressTk },
|
||||
ru: { value: form.addressRu, onChange: (v: string) => set('addressRu', v), error: errors.addressRu },
|
||||
en: { value: form.addressEn, onChange: (v: string) => set('addressEn', v), error: errors.addressEn },
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="flex gap-3 justify-end mb-2">
|
||||
{LANG_TABS.map((tab) => (
|
||||
<button
|
||||
key={tab.key}
|
||||
type="button"
|
||||
onClick={() => setActiveLang(tab.key)}
|
||||
className={`text-sm transition-colors ${
|
||||
activeLang === tab.key
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground hover:text-foreground'
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<FormInput
|
||||
type="text"
|
||||
label="Salgy"
|
||||
required
|
||||
value={form[addrFieldKey]}
|
||||
onChange={(v) => set(addrFieldKey, v)}
|
||||
placeholder="Salgy"
|
||||
error={errors[addrErrorKey]}
|
||||
/>
|
||||
<MultiLangInput fields={addressFields} placeholder={t('branches.fields.address', 'Salgy')} />
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
||||
<FormInput
|
||||
type="phone"
|
||||
label="Telefon"
|
||||
label={t('branches.fields.phone', 'Telefon')}
|
||||
required
|
||||
value={form.phone}
|
||||
onChange={(v) => set('phone', v)}
|
||||
@@ -206,7 +156,7 @@ function StepAddress({ form, errors, set, activeLang, setActiveLang }: StepConte
|
||||
/>
|
||||
<FormInput
|
||||
type="email"
|
||||
label="E-poçta"
|
||||
label={t('branches.fields.email', 'E-poçta')}
|
||||
required
|
||||
value={form.email}
|
||||
onChange={(v) => set('email', v)}
|
||||
@@ -218,13 +168,13 @@ function StepAddress({ form, errors, set, activeLang, setActiveLang }: StepConte
|
||||
)
|
||||
}
|
||||
|
||||
function StepHours({ form, errors, set }: StepContentProps) {
|
||||
function StepHours({ form, errors, set, t }: StepContentProps) {
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
||||
<FormInput
|
||||
type="text"
|
||||
label="Iş wagty"
|
||||
label={t('branches.fields.workingHours', 'Iş wagty')}
|
||||
required
|
||||
value={form.workingHours}
|
||||
onChange={(v) => set('workingHours', v)}
|
||||
@@ -234,7 +184,7 @@ function StepHours({ form, errors, set }: StepContentProps) {
|
||||
</div>
|
||||
<FormInput
|
||||
type="textarea"
|
||||
label="Bellikler"
|
||||
label={t('branches.fields.description', 'Bellikler')}
|
||||
value={form.description}
|
||||
onChange={(v) => set('description', v)}
|
||||
placeholder="Goşmaça maglumatlar..."
|
||||
@@ -273,14 +223,13 @@ export function BranchForm({ mode, initialData }: BranchFormProps) {
|
||||
(key, fallback) => _t(key, fallback ?? key) as string,
|
||||
[_t],
|
||||
)
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
const navigate = useNavigate()
|
||||
|
||||
const createMutation = useCreateBranch()
|
||||
const updateMutation = useUpdateBranch()
|
||||
const isPending = createMutation.isPending || updateMutation.isPending
|
||||
|
||||
const [activeLang, setActiveLang] = useState<LangKey>('tk')
|
||||
|
||||
const schema = useMemo(() => createBranchFormSchema(t), [t, i18n.language])
|
||||
|
||||
const {
|
||||
@@ -312,7 +261,7 @@ export function BranchForm({ mode, initialData }: BranchFormProps) {
|
||||
clearErrors(key)
|
||||
}, [setValue, clearErrors])
|
||||
|
||||
const stepProps = useMemo(() => ({ form, errors, set, activeLang, setActiveLang }), [form, errors, set, activeLang])
|
||||
const stepProps = useMemo(() => ({ form, errors, set, t, lang }), [form, errors, set, t, lang])
|
||||
|
||||
const markVisited = (i: number) =>
|
||||
setVisited((prev) => new Set([...prev, i]))
|
||||
@@ -409,7 +358,7 @@ export function BranchForm({ mode, initialData }: BranchFormProps) {
|
||||
<div className="flex flex-col gap-5">
|
||||
<div className="flex flex-col gap-1">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
{mode === 'create' ? t('branches.create.title', 'Şahamça döretmek') : t('branches.edit.title', 'Şahamçany üýtgetmek')}
|
||||
{mode === 'create' ? t('branches.createTitle', 'Şahamça döretmek') : t('branches.editTitle', 'Şahamçany üýtgetmek')}
|
||||
</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t('branches.form.subtitle', 'Ähli meýdanlary dolduryp, ädim-ädim öň geçiň.')}
|
||||
|
||||
@@ -25,12 +25,6 @@ interface CardPinFormProps {
|
||||
|
||||
// ─── Constants ────────────────────────────────────────────────────────────────
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ value: 'pending', label: 'Garaşylýar' },
|
||||
{ value: 'approved', label: 'Tassyklandy' },
|
||||
{ value: 'rejected', label: 'Ret edildi' },
|
||||
]
|
||||
|
||||
const CARD_TYPE_OPTIONS = [
|
||||
{ value: 'altyn_asyr', label: 'Altyn Asyr' },
|
||||
{ value: 'visa', label: 'Visa' },
|
||||
@@ -120,6 +114,12 @@ interface StepContentProps {
|
||||
// ─── Step panels ──────────────────────────────────────────────────────────────
|
||||
|
||||
function StepCard({ form, errors, set, t }: StepContentProps) {
|
||||
const STATUS_OPTIONS = useMemo(() => [
|
||||
{ value: 'pending', label: t('cardPin.status.pending', 'Garaşylýar') },
|
||||
{ value: 'approved', label: t('cardPin.status.approved', 'Tassyklandy') },
|
||||
{ value: 'rejected', label: t('cardPin.status.rejected', 'Ret edildi') },
|
||||
], [t])
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<BentoGrid cols={2}>
|
||||
|
||||
@@ -109,8 +109,8 @@ export function CardReasonForm({ mode, initialData }: CardReasonFormProps) {
|
||||
<div className="flex flex-col gap-5">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
{mode === 'create'
|
||||
? t('reasons.createTitle', 'Sebäp dörediň')
|
||||
: t('reasons.editTitle', 'Sebäp üýtgetmek')}
|
||||
? t('cardReasons.createTitle', 'Sebäp dörediň')
|
||||
: t('cardReasons.editTitle', 'Sebäp üýtgetmek')}
|
||||
</h1>
|
||||
<div>
|
||||
{/* Form rows */}
|
||||
@@ -118,23 +118,23 @@ export function CardReasonForm({ mode, initialData }: CardReasonFormProps) {
|
||||
{/* Name row */}
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-4 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-2">
|
||||
{t('CardReasons.fields.name', 'Ady')}
|
||||
{t('cardReasons.fields.name', 'Ady')}
|
||||
<span className="text-destructive ml-0.5">*</span>
|
||||
</span>
|
||||
<MultiLangInput fields={nameFields} placeholder={t('CardReasons.fields.name', 'Ady')} disabled={isPending} />
|
||||
<MultiLangInput fields={nameFields} placeholder={t('cardReasons.fields.name', 'Ady')} disabled={isPending} />
|
||||
</div>
|
||||
|
||||
{/* Value row */}
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-3 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{t('CardReasons.fields.value', 'Baha')}
|
||||
{t('cardReasons.fields.value', 'Baha')}
|
||||
<span className="text-destructive ml-0.5">*</span>
|
||||
</span>
|
||||
<FormInput
|
||||
type="number"
|
||||
value={form.value}
|
||||
onChange={(v) => set('value', v)}
|
||||
placeholder={t('CardReasons.fields.value', 'Baha')}
|
||||
placeholder={t('cardReasons.fields.value', 'Baha')}
|
||||
error={errors.value}
|
||||
/>
|
||||
</div>
|
||||
@@ -142,20 +142,20 @@ export function CardReasonForm({ mode, initialData }: CardReasonFormProps) {
|
||||
{/* Description row */}
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-3 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{t('CardReasons.fields.description', 'Bellikler')}
|
||||
{t('cardReasons.fields.description', 'Bellikler')}
|
||||
</span>
|
||||
<FormInput
|
||||
type="text"
|
||||
value={form.description}
|
||||
onChange={(v) => set('description', v)}
|
||||
placeholder={t('CardReasons.fields.description', 'Bellikler')}
|
||||
placeholder={t('cardReasons.fields.description', 'Bellikler')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* isActive row */}
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-3 px-4">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{t('CardReasons.fields.isActive', 'Işjeň')}
|
||||
{t('cardReasons.fields.isActive', 'Işjeň')}
|
||||
</span>
|
||||
<Checkbox
|
||||
checked={form.isActive}
|
||||
@@ -170,8 +170,8 @@ export function CardReasonForm({ mode, initialData }: CardReasonFormProps) {
|
||||
onCancel={() => navigate('/resources/card-states')}
|
||||
cancelVariant="ghost"
|
||||
submitLabel={mode === 'create'
|
||||
? t('CardReasons.actions.create', 'Kartyň çykarylmagynyň sebäbini döretdiň')
|
||||
: t('CardReasons.actions.update', 'Täzelemek')}
|
||||
? t('cardReasons.actions.create', 'Kartyň çykarylmagynyň sebäbini döretdiň')
|
||||
: t('cardReasons.actions.update', 'Täzelemek')}
|
||||
className="mt-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState, useCallback, useMemo, useEffect } from 'react'
|
||||
import { useCallback, useMemo, useEffect } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useForm } from 'react-hook-form'
|
||||
@@ -6,6 +6,7 @@ import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { Checkbox } from '@/components/ui/checkbox'
|
||||
import { FormActions } from '@/components/formActions'
|
||||
import { FormInput } from '@/components/formInput'
|
||||
import { MultiLangInput } from '@/components/multiLangInput'
|
||||
import type { District } from '../api/districtsApi'
|
||||
import { useCreateDistrict, useUpdateDistrict } from '../hooks/useDistricts'
|
||||
import { createDistrictFormSchema, DEFAULT_FORM_VALUES, buildPayload } from '../schemas/district.schema'
|
||||
@@ -22,21 +23,11 @@ function flattenErrors(errors: Record<string, { message?: string } | undefined>)
|
||||
return result
|
||||
}
|
||||
|
||||
type FormErrors = FlatErrors
|
||||
|
||||
export interface DistrictFormProps {
|
||||
mode: 'create' | 'edit'
|
||||
initialData?: District
|
||||
}
|
||||
|
||||
type LangKey = 'tk' | 'ru' | 'en'
|
||||
|
||||
const LANG_TABS: { key: LangKey; label: string }[] = [
|
||||
{ key: 'tk', label: 'Türkmen' },
|
||||
{ key: 'ru', label: 'Русский' },
|
||||
{ key: 'en', label: 'English' },
|
||||
]
|
||||
|
||||
function mapInitial(data: District): DistrictFormData {
|
||||
return {
|
||||
nameTk: data.name.tk,
|
||||
@@ -72,8 +63,6 @@ export function DistrictForm({ mode, initialData }: DistrictFormProps) {
|
||||
const form = watch()
|
||||
const errors = useMemo(() => flattenErrors(rhfErrors as Record<string, { message?: string } | undefined>), [rhfErrors])
|
||||
|
||||
const [activeLang, setActiveLang] = useState<LangKey>('tk')
|
||||
|
||||
const set = useCallback(<K extends keyof DistrictFormData>(key: K) =>
|
||||
(value: DistrictFormData[K]) => {
|
||||
(setValue as (name: K, val: DistrictFormData[K]) => void)(key, value)
|
||||
@@ -104,11 +93,11 @@ export function DistrictForm({ mode, initialData }: DistrictFormProps) {
|
||||
}
|
||||
}
|
||||
|
||||
const nameFieldKey = `name${activeLang.charAt(0).toUpperCase() + activeLang.slice(1)}` as
|
||||
| 'nameTk'
|
||||
| 'nameRu'
|
||||
| 'nameEn'
|
||||
const nameErrorKey = nameFieldKey as keyof FormErrors
|
||||
const nameFields = {
|
||||
tk: { value: form.nameTk, onChange: set('nameTk'), error: errors.nameTk },
|
||||
ru: { value: form.nameRu, onChange: set('nameRu'), error: errors.nameRu },
|
||||
en: { value: form.nameEn, onChange: set('nameEn'), error: errors.nameEn },
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
@@ -118,36 +107,13 @@ export function DistrictForm({ mode, initialData }: DistrictFormProps) {
|
||||
: t('districts.editTitle', 'Etrap üýtgetmek')}
|
||||
</h1>
|
||||
<div>
|
||||
<div className="flex gap-3 justify-end mb-4">
|
||||
{LANG_TABS.map((tab) => (
|
||||
<button
|
||||
key={tab.key}
|
||||
type="button"
|
||||
onClick={() => setActiveLang(tab.key)}
|
||||
className={`text-sm transition-colors ${
|
||||
activeLang === tab.key
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground hover:text-foreground'
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="bg-card border border-border rounded-xl overflow-hidden">
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-3 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
<div className="grid grid-cols-[220px_1fr] items-start px-4 py-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-2">
|
||||
{t('districts.fields.name', 'Ady')}
|
||||
<span className="text-destructive ml-0.5">*</span>
|
||||
</span>
|
||||
<FormInput
|
||||
type="text"
|
||||
value={form[nameFieldKey]}
|
||||
onChange={set(nameFieldKey)}
|
||||
placeholder={t('districts.fields.name', 'Ady')}
|
||||
error={errors[nameErrorKey]}
|
||||
/>
|
||||
<MultiLangInput fields={nameFields} placeholder={t('districts.fields.name', 'Ady')} />
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-3 px-4 border-b border-border">
|
||||
|
||||
@@ -40,11 +40,7 @@ interface RequiredDocumentFormProps {
|
||||
|
||||
// ─── Lang tabs ────────────────────────────────────────────────────────────────
|
||||
|
||||
const LOCALES: { code: Locale; label: string }[] = [
|
||||
{ code: 'tk', label: 'Türkmen' },
|
||||
{ code: 'ru', label: 'Русский' },
|
||||
{ code: 'en', label: 'English' },
|
||||
]
|
||||
const LOCALES: Locale[] = ['tk', 'ru', 'en']
|
||||
|
||||
// ─── Tiptap Toolbar ───────────────────────────────────────────────────────────
|
||||
|
||||
@@ -148,9 +144,10 @@ interface LangTabsProps {
|
||||
}
|
||||
|
||||
function LangTabs({ active, onChange }: LangTabsProps) {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<div className="flex items-center justify-end gap-3 mb-2">
|
||||
{LOCALES.map(({ code, label }) => (
|
||||
{LOCALES.map((code) => (
|
||||
<button
|
||||
key={code}
|
||||
type="button"
|
||||
@@ -162,7 +159,7 @@ function LangTabs({ active, onChange }: LangTabsProps) {
|
||||
: 'text-muted-foreground hover:text-foreground'
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
{t('languages.' + code, code === 'tk' ? 'Türkmen' : code === 'ru' ? 'Русский' : 'English')}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -326,9 +323,9 @@ export function RequiredDocumentForm({ mode, initialData }: RequiredDocumentForm
|
||||
error={errors[`name_${nameLang}`]}
|
||||
/>
|
||||
{/* Show errors for other locales as hints */}
|
||||
{LOCALES.filter((l) => l.code !== nameLang && errors[`name_${l.code}`]).map(({ code, label }) => (
|
||||
{LOCALES.filter((l) => l !== nameLang && errors[`name_${l}`]).map((code) => (
|
||||
<p key={code} className="mt-1 text-xs text-destructive/70">
|
||||
{label}: {errors[`name_${code}`]}
|
||||
{t('languages.' + code, code === 'tk' ? 'Türkmen' : code === 'ru' ? 'Русский' : 'English')}: {errors[`name_${code}`]}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
@@ -347,9 +344,9 @@ export function RequiredDocumentForm({ mode, initialData }: RequiredDocumentForm
|
||||
onChange={(val) => setDescription((prev) => ({ ...prev, [descLang]: val }))}
|
||||
error={errors[`desc_${descLang}`]}
|
||||
/>
|
||||
{LOCALES.filter((l) => l.code !== descLang && errors[`desc_${l.code}`]).map(({ code, label }) => (
|
||||
{LOCALES.filter((l) => l !== descLang && errors[`desc_${l}`]).map((code) => (
|
||||
<p key={code} className="mt-1 text-xs text-destructive/70">
|
||||
{label}: {errors[`desc_${code}`]}
|
||||
{t('languages.' + code, code === 'tk' ? 'Türkmen' : code === 'ru' ? 'Русский' : 'English')}: {errors[`desc_${code}`]}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -362,6 +362,13 @@
|
||||
"Enter your username to continue": "Enter your username to continue",
|
||||
"Old surname (if changed)": "Old surname (if changed)",
|
||||
"common.view": "View",
|
||||
"common.download": "Download",
|
||||
"audit.columns.id": "ID",
|
||||
"audit.columns.action": "ACTION NAME",
|
||||
"audit.columns.by": "PERFORMED BY",
|
||||
"audit.columns.target": "TARGET",
|
||||
"audit.columns.status": "STATUS",
|
||||
"audit.columns.date": "DATE",
|
||||
"common.edit": "Edit",
|
||||
"common.delete": "Delete",
|
||||
"common.goBack": "Go back",
|
||||
@@ -427,6 +434,24 @@
|
||||
"Resources": "Resources",
|
||||
"Currency rates": "Currency rates",
|
||||
"Loan balance": "Loan balance",
|
||||
"loanDocuments.title": "Loan required documents",
|
||||
"loanDocuments.viewTitle": "Loan document detail",
|
||||
"loanDocuments.createBtn": "Create loan document",
|
||||
"loanDocuments.createTitle": "Create loan document",
|
||||
"loanDocuments.editTitle": "Edit loan document",
|
||||
"loanDocuments.columns.name": "NAME",
|
||||
"loanDocuments.deleteConfirm": "Are you sure you want to delete this document?",
|
||||
"loanDocuments.form.create": "Create loan document",
|
||||
"loanDocuments.form.update": "Update loan document",
|
||||
"loanDocuments.fields.name": "Name",
|
||||
"loanDocuments.fields.namePlaceholder": "Name",
|
||||
"loanDocuments.fields.description": "Description",
|
||||
"loanDocuments.toast.created": "Document created successfully!",
|
||||
"loanDocuments.toast.createError": "Error creating document!",
|
||||
"loanDocuments.toast.updated": "Document updated successfully!",
|
||||
"loanDocuments.toast.updateError": "Error updating document!",
|
||||
"loanDocuments.toast.deleted": "Document deleted successfully!",
|
||||
"loanDocuments.toast.deleteError": "Error deleting document!",
|
||||
"common.cancel": "Cancel",
|
||||
"common.confirm": "Confirm",
|
||||
"common.back": "Back",
|
||||
@@ -434,6 +459,7 @@
|
||||
"common.save": "Save",
|
||||
"common.create": "Create",
|
||||
"common.loading": "Loading...",
|
||||
"common.form.subtitle": "Fill in all fields and proceed step by step.",
|
||||
"common.errors.fillRequiredCorrectly": "Please enter correct data.",
|
||||
"common.errors.requiredFieldsMissing": "Some required fields are missing.",
|
||||
"validation.required": "Required field",
|
||||
@@ -515,6 +541,16 @@
|
||||
"cardOrder.status.pending": "Pending",
|
||||
"cardOrder.status.approved": "Approved",
|
||||
"cardOrder.status.rejected": "Rejected",
|
||||
"cardOrder.col.id": "ID",
|
||||
"cardOrder.col.reason": "Reason",
|
||||
"cardOrder.col.createdAt": "Created at",
|
||||
"cardOrder.col.cardType": "Card type",
|
||||
"cardOrder.col.province": "Province",
|
||||
"cardOrder.col.branch": "Branch",
|
||||
"cardOrder.col.name": "Name",
|
||||
"cardOrder.col.status": "Status",
|
||||
"cardOrder.create": "Create card order",
|
||||
"cardOrder.deleteConfirm": "Delete this order?",
|
||||
"citizenship.tm": "Turkmenistan",
|
||||
"citizenship.ru": "Russia",
|
||||
"citizenship.other": "Other",
|
||||
@@ -542,6 +578,8 @@
|
||||
"cardPin.step.passport": "Passport",
|
||||
"cardPin.createBtn": "Create PIN envelope",
|
||||
"cardPin.editBtn": "Edit PIN envelope",
|
||||
"cardPin.createTitle": "Create PIN envelope",
|
||||
"cardPin.editTitle": "Edit PIN envelope",
|
||||
"intlPaymentForm.steps.general.title": "General",
|
||||
"intlPaymentForm.steps.general.subtitle": "Status, client",
|
||||
"intlPaymentForm.steps.location.title": "Location",
|
||||
@@ -690,9 +728,27 @@
|
||||
"sberPayments.view.delete": "Delete",
|
||||
"allUsers.title": "All users",
|
||||
"backups.title": "Backups",
|
||||
"backups.create": "Create backup",
|
||||
"backups.col.fileName": "File name",
|
||||
"backups.col.fileSize": "Size",
|
||||
"backups.col.status": "Status",
|
||||
"backups.col.createdAt": "Created at",
|
||||
"backups.col.createdBy": "Created by",
|
||||
"backups.status.completed": "Completed",
|
||||
"backups.status.failed": "Failed",
|
||||
"backups.status.inProgress": "In progress",
|
||||
"backups.deleteConfirm.title": "Are you sure?",
|
||||
"backups.deleteConfirm.description": "Delete this backup? This action cannot be undone.",
|
||||
"branches.createTitle": "Create branch",
|
||||
"branches.editTitle": "Edit branch",
|
||||
"branches.title": "Branches",
|
||||
"branches.actions.create": "Create branch",
|
||||
"branches.actions.update": "Update branch",
|
||||
"branches.deleteConfirm": "Are you sure you want to delete this branch?",
|
||||
"branches.form.subtitle": "Fill in all fields and proceed step by step.",
|
||||
"branches.sections.address": "Address and contact",
|
||||
"branches.sections.basic": "Basic information",
|
||||
"branches.sections.hours": "Working hours",
|
||||
"branches.viewTitle": "Branch detail",
|
||||
"cardBalance.createTitle": "Create card balance",
|
||||
"cardBalance.editTitle": "Edit card balance",
|
||||
@@ -705,6 +761,13 @@
|
||||
"cardReasons.createTitle": "Create reason",
|
||||
"cardReasons.editTitle": "Edit reason",
|
||||
"cardReasons.title": "Card issuance reasons",
|
||||
"cardReasons.actions.create": "Create reason",
|
||||
"cardReasons.actions.update": "Update reason",
|
||||
"cardReasons.deleteConfirm": "Are you sure you want to delete this reason?",
|
||||
"cardReasons.fields.description": "DESCRIPTION",
|
||||
"cardReasons.fields.isActive": "ACTIVE",
|
||||
"cardReasons.fields.name": "NAME",
|
||||
"cardReasons.fields.value": "VALUE",
|
||||
"cardReasons.viewTitle": "Reason detail",
|
||||
"cardRequisites.createTitle": "Create card requisites",
|
||||
"cardRequisites.editTitle": "Edit card requisites",
|
||||
@@ -713,6 +776,12 @@
|
||||
"cardTypes.createTitle": "Create card type",
|
||||
"cardTypes.editTitle": "Edit card type",
|
||||
"cardTypes.title": "Card types",
|
||||
"cardTypes.actions.create": "Create card type",
|
||||
"cardTypes.deleteConfirm": "Are you sure you want to delete this card type?",
|
||||
"cardTypes.fields.description": "DESCRIPTION",
|
||||
"cardTypes.fields.isActive": "ACTIVE",
|
||||
"cardTypes.fields.name": "NAME",
|
||||
"cardTypes.fields.value": "VALUE",
|
||||
"cardTypes.view.title": "Card type detail",
|
||||
"clients.createTitle": "Create client",
|
||||
"clients.editTitle": "Edit client",
|
||||
@@ -724,6 +793,12 @@
|
||||
"districts.createTitle": "Create district",
|
||||
"districts.editTitle": "Edit district",
|
||||
"districts.title": "Districts",
|
||||
"districts.actions.create": "Create district",
|
||||
"districts.actions.update": "Update district",
|
||||
"districts.deleteConfirm": "Are you sure you want to delete this district?",
|
||||
"districts.fields.description": "NOTES",
|
||||
"districts.fields.isActive": "ACTIVE",
|
||||
"districts.fields.name": "NAME",
|
||||
"districts.viewTitle": "District detail",
|
||||
"intlPayment.createTitle": "Create Visa/Master payment",
|
||||
"intlPayment.editTitle": "Edit Visa/Master payment",
|
||||
@@ -737,9 +812,46 @@
|
||||
"loanTypes.createTitle": "Create loan type",
|
||||
"loanTypes.editTitle": "Edit loan type",
|
||||
"loanTypes.title": "Loan types",
|
||||
"loanTypes.actions.create": "Create loan type",
|
||||
"loanTypes.columns.isActive": "ACTIVE",
|
||||
"loanTypes.columns.loanTerm": "LOAN TERM",
|
||||
"loanTypes.columns.name": "NAME",
|
||||
"loanTypes.columns.notes": "NOTES",
|
||||
"loanTypes.columns.tax": "TAX",
|
||||
"loanTypes.deleteDialog.description": "Are you sure you want to delete this loan type? This action cannot be undone.",
|
||||
"loanTypes.deleteDialog.title": "Delete",
|
||||
"loanTypes.fields.isActive": "Active",
|
||||
"loanTypes.fields.loanTerm": "Loan term",
|
||||
"loanTypes.fields.name": "Name",
|
||||
"loanTypes.fields.notes": "Notes",
|
||||
"loanTypes.fields.tax": "Tax",
|
||||
"loanTypes.actions.save": "Save",
|
||||
"loanTypes.viewTitle": "Loan type detail",
|
||||
"notFound": "Not found",
|
||||
"onlinePayments.title": "Online payments",
|
||||
"onlinePayments.columns.amount": "AMOUNT",
|
||||
"onlinePayments.columns.apiClient": "API CLIENT",
|
||||
"onlinePayments.columns.description": "DESCRIPTION",
|
||||
"onlinePayments.columns.status": "STATUS",
|
||||
"onlinePayments.columns.username": "USERNAME",
|
||||
"onlinePayments.columns.createdAt": "CREATED AT",
|
||||
"onlinePayments.actions.callback": "Send callback",
|
||||
"onlinePayments.detail.title": "Online payment detail",
|
||||
"onlinePayments.notFound": "Payment not found",
|
||||
"onlinePayments.fields.amount": "Amount",
|
||||
"onlinePayments.fields.orderNumber": "Order number",
|
||||
"onlinePayments.fields.apiClient": "API Client",
|
||||
"onlinePayments.fields.description": "Description",
|
||||
"onlinePayments.fields.orderId": "Order ID",
|
||||
"onlinePayments.fields.formUrl": "Form URL",
|
||||
"onlinePayments.fields.successUrl": "Success URL",
|
||||
"onlinePayments.fields.status": "Status",
|
||||
"onlinePayments.fields.callbackStatus": "Callback status",
|
||||
"onlinePayments.fields.username": "Username",
|
||||
"onlinePayments.fields.onlinePaymantableId": "Online payment table ID",
|
||||
"onlinePayments.fields.onlinePaymantableType": "Online payment table type",
|
||||
"onlinePayments.fields.createdAt": "Created at",
|
||||
"onlinePayments.fields.updatedAt": "Updated at",
|
||||
"permissions.createTitle": "Create permission",
|
||||
"permissions.editTitle": "Edit permission",
|
||||
"permissions.title": "Permissions",
|
||||
@@ -974,9 +1086,25 @@
|
||||
"intlPayment.status.pending": "Pending",
|
||||
"intlPayment.status.approved": "Approved",
|
||||
"intlPayment.status.rejected": "Rejected",
|
||||
"intlPayment.col.id": "ID",
|
||||
"intlPayment.createdAt": "Created at",
|
||||
"intlPayment.firstName": "First name",
|
||||
"intlPayment.lastName": "Last name",
|
||||
"intlPayment.createBtn": "Create Visa/Master payment",
|
||||
"permissions.actions.create": "Create permission",
|
||||
"permissions.deleteDialog.description": "Are you sure you want to delete this permission? This action cannot be undone.",
|
||||
"permissions.deleteDialog.title": "Delete permission",
|
||||
"permissions.fields.code": "CODE",
|
||||
"permissions.fields.guardName": "GUARD NAME",
|
||||
"permissions.fields.name": "NAME",
|
||||
"permissions.searchPlaceholder": "Search...",
|
||||
"roles.actions.create": "Create role",
|
||||
"roles.deleteDialog.description": "Are you sure you want to delete this role? This action cannot be undone.",
|
||||
"roles.deleteDialog.title": "Delete role",
|
||||
"roles.fields.code": "CODE",
|
||||
"roles.fields.name": "NAME",
|
||||
"roles.fields.guardName": "GUARD NAME",
|
||||
"roles.fields.name": "NAME",
|
||||
"roles.searchPlaceholder": "Search...",
|
||||
"branches.fields.name": "NAME",
|
||||
"branches.fields.region": "REGION",
|
||||
"branches.fields.district": "DISTRICT",
|
||||
@@ -984,7 +1112,15 @@
|
||||
"branches.fields.isActive": "ACTIVE",
|
||||
"branches.fields.billingIbr": "BILLING USERNAME (IBR)",
|
||||
"branches.fields.billingSber": "BILLING USERNAME (SBER)",
|
||||
"branches.fields.address": "ADDRESS",
|
||||
"branches.fields.billingVisa": "BILLING USERNAME (VISA)",
|
||||
"branches.fields.code": "CODE",
|
||||
"branches.fields.description": "NOTES",
|
||||
"branches.fields.email": "EMAIL",
|
||||
"branches.fields.phone": "PHONE",
|
||||
"branches.fields.workingHours": "WORKING HOURS",
|
||||
"users.title": "All users",
|
||||
"users.searchPlaceholder": "Search",
|
||||
"users.createTitle": "Add New User",
|
||||
"users.viewTitle": "User details",
|
||||
"users.fields.username": "Username",
|
||||
@@ -992,6 +1128,17 @@
|
||||
"users.fields.phone": "Phone",
|
||||
"users.fields.email": "Email",
|
||||
"users.fields.isActive": "Active",
|
||||
"users.fields.isActiveHint": "Whether the user can log in",
|
||||
"users.fields.usernameHint": "Unique login name",
|
||||
"users.fields.nameHint": "Full name and surname",
|
||||
"users.fields.phoneHint": "Starts with +993",
|
||||
"users.fields.emailHint": "Optional",
|
||||
"users.fields.password": "Password",
|
||||
"users.fields.passwordHint": "At least 6 characters",
|
||||
"users.fields.phoneVerified": "Phone verified",
|
||||
"users.fields.phoneVerifiedHint": "Verified via SMS",
|
||||
"users.actions.create": "Create user",
|
||||
"users.actions.save": "Save",
|
||||
"users.sections.roles": "Roles",
|
||||
"users.actions.addRole": "Add role",
|
||||
"users.empty.roles": "No roles match your criteria.",
|
||||
@@ -1014,6 +1161,11 @@
|
||||
"clients.sections.contact": "Contact",
|
||||
"clients.fields.phone": "Phone",
|
||||
"clients.fields.email": "Email",
|
||||
"clients.fields.password": "Password",
|
||||
"clients.fields.passwordEditHint": "Enter a new password to change",
|
||||
"clients.fields.passwordEditNote": "Leave empty to keep current password",
|
||||
"clients.createBtn": "Create client",
|
||||
"clients.updateBtn": "Save changes",
|
||||
"clients.sections.roles": "Roles",
|
||||
"clients.addRole": "Add role",
|
||||
"clients.noRoles": "No roles match your criteria.",
|
||||
@@ -1033,5 +1185,34 @@
|
||||
"clients.deleteConfirm": "Are you sure you want to delete client {{name}}?",
|
||||
"languages.tk": "Türkmen",
|
||||
"languages.ru": "Russian",
|
||||
"languages.en": "English"
|
||||
"languages.en": "English",
|
||||
"nav.dashboard": "Dashboard",
|
||||
"nav.settings": "Settings",
|
||||
"loanOrders.viewTitle": "Loan order detail",
|
||||
"loanOrderMobiles.viewTitle": "Loan order detail (Mobile)",
|
||||
"loanRemaining.viewTitle": "Loan remaining detail",
|
||||
"loanPaidOffLetters.viewTitle": "Certificate detail",
|
||||
"cardOrder.viewTitle": "Card order detail",
|
||||
"cardTransactions.title": "Card transactions",
|
||||
"cardTransactions.viewTitle": "Card transaction detail",
|
||||
"cardRequisites.title": "Card requisites",
|
||||
"cardRequisites.viewTitle": "Card requisite detail",
|
||||
"cardBalance.viewTitle": "Card balance detail",
|
||||
"cardPins.title": "Card PIN envelopes",
|
||||
"cardPins.viewTitle": "Card PIN envelope detail",
|
||||
"visaMaster.title": "Visa/Master payments",
|
||||
"visaMaster.createTitle": "Create Visa/Master payment",
|
||||
"visaMaster.viewTitle": "Visa/Master payment detail",
|
||||
"visaMaster.editTitle": "Edit Visa/Master payment",
|
||||
"operators.viewTitle": "Operator detail",
|
||||
"allUsers.createTitle": "Create user",
|
||||
"allUsers.viewTitle": "User detail",
|
||||
"allUsers.editTitle": "Edit user",
|
||||
"clients.viewTitle": "Client detail",
|
||||
"currencyRates.viewTitle": "Currency rate detail",
|
||||
"visaMasterSberSettings.title": "Visa/Master, Sber Settings",
|
||||
"visaMasterSberSettings.createTitle": "Create setting",
|
||||
"visaMasterSberSettings.editTitle": "Edit setting",
|
||||
"onlinePayments.viewTitle": "Payment detail",
|
||||
"cardTypes.viewTitle": "Card type detail"
|
||||
}
|
||||
@@ -362,6 +362,13 @@
|
||||
"Enter your username to continue": "Введите свое имя пользователя, чтобы продолжить",
|
||||
"Old surname (if changed)": "Старая фамилия (если менялась)",
|
||||
"common.view": "Просмотр",
|
||||
"common.download": "Скачать",
|
||||
"audit.columns.id": "ID",
|
||||
"audit.columns.action": "НАЗВАНИЕ ОПЕРАЦИИ",
|
||||
"audit.columns.by": "КЕМ ВЫПОЛНЕНО",
|
||||
"audit.columns.target": "ЦЕЛЬ ОПЕРАЦИИ",
|
||||
"audit.columns.status": "СТАТУС ОПЕРАЦИИ",
|
||||
"audit.columns.date": "ДАТА",
|
||||
"common.edit": "Редактировать",
|
||||
"common.delete": "Удалить",
|
||||
"common.goBack": "Назад",
|
||||
@@ -427,6 +434,24 @@
|
||||
"Resources": "Ресурсы",
|
||||
"Currency rates": "Курсы валют",
|
||||
"Loan balance": "Остаток кредита",
|
||||
"loanDocuments.title": "Требуемые документы кредита",
|
||||
"loanDocuments.viewTitle": "Детали требуемого документа кредита",
|
||||
"loanDocuments.createBtn": "Создать требуемый документ кредита",
|
||||
"loanDocuments.createTitle": "Создать требуемый документ кредита",
|
||||
"loanDocuments.editTitle": "Редактировать требуемый документ кредита",
|
||||
"loanDocuments.columns.name": "НАЗВАНИЕ",
|
||||
"loanDocuments.deleteConfirm": "Вы уверены, что хотите удалить этот документ?",
|
||||
"loanDocuments.form.create": "Создать требуемый документ кредита",
|
||||
"loanDocuments.form.update": "Обновить требуемый документ кредита",
|
||||
"loanDocuments.fields.name": "Название",
|
||||
"loanDocuments.fields.namePlaceholder": "Название",
|
||||
"loanDocuments.fields.description": "Описание",
|
||||
"loanDocuments.toast.created": "Документ успешно создан!",
|
||||
"loanDocuments.toast.createError": "Ошибка при создании документа!",
|
||||
"loanDocuments.toast.updated": "Документ успешно обновлен!",
|
||||
"loanDocuments.toast.updateError": "Ошибка при обновлении документа!",
|
||||
"loanDocuments.toast.deleted": "Документ успешно удален!",
|
||||
"loanDocuments.toast.deleteError": "Ошибка при удалении документа!",
|
||||
"common.cancel": "Отмена",
|
||||
"common.confirm": "Подтвердить",
|
||||
"common.back": "Назад",
|
||||
@@ -434,6 +459,7 @@
|
||||
"common.save": "Сохранить",
|
||||
"common.create": "Создать",
|
||||
"common.loading": "Загрузка...",
|
||||
"common.form.subtitle": "Заполните все поля и переходите по шагам.",
|
||||
"common.errors.fillRequiredCorrectly": "Пожалуйста, введите корректные данные.",
|
||||
"common.errors.requiredFieldsMissing": "Некоторые обязательные поля не заполнены.",
|
||||
"validation.required": "Обязательное поле",
|
||||
@@ -515,6 +541,16 @@
|
||||
"cardOrder.status.pending": "В ожидании",
|
||||
"cardOrder.status.approved": "Одобрено",
|
||||
"cardOrder.status.rejected": "Отклонено",
|
||||
"cardOrder.col.id": "ID",
|
||||
"cardOrder.col.reason": "Причина",
|
||||
"cardOrder.col.createdAt": "Дата создания",
|
||||
"cardOrder.col.cardType": "Тип карты",
|
||||
"cardOrder.col.province": "Район",
|
||||
"cardOrder.col.branch": "Филиал",
|
||||
"cardOrder.col.name": "Имя",
|
||||
"cardOrder.col.status": "Статус",
|
||||
"cardOrder.create": "Создать заказ карты",
|
||||
"cardOrder.deleteConfirm": "Удалить этот заказ?",
|
||||
"citizenship.tm": "Туркменистан",
|
||||
"citizenship.ru": "Россия",
|
||||
"citizenship.other": "Другое",
|
||||
@@ -544,6 +580,8 @@
|
||||
"cardPin.step.passport": "Паспорт",
|
||||
"cardPin.createBtn": "Создать ПИН-конверт",
|
||||
"cardPin.editBtn": "Редактировать ПИН-конверт",
|
||||
"cardPin.createTitle": "Создать ПИН-конверт",
|
||||
"cardPin.editTitle": "Редактировать ПИН-конверт",
|
||||
"intlPaymentForm.steps.general.title": "Основное",
|
||||
"intlPaymentForm.steps.general.subtitle": "Статус, клиент",
|
||||
"intlPaymentForm.steps.location.title": "Местоположение",
|
||||
@@ -691,9 +729,27 @@
|
||||
"sberPayments.view.delete": "Удалить",
|
||||
"allUsers.title": "Все пользователи",
|
||||
"backups.title": "Резервные копии",
|
||||
"backups.create": "Создать резервную копию",
|
||||
"backups.col.fileName": "Имя файла",
|
||||
"backups.col.fileSize": "Размер",
|
||||
"backups.col.status": "Статус",
|
||||
"backups.col.createdAt": "Дата создания",
|
||||
"backups.col.createdBy": "Создатель",
|
||||
"backups.status.completed": "Завершено",
|
||||
"backups.status.failed": "Ошибка",
|
||||
"backups.status.inProgress": "В процессе",
|
||||
"backups.deleteConfirm.title": "Вы уверены?",
|
||||
"backups.deleteConfirm.description": "Удалить эту резервную копию? Это действие нельзя отменить.",
|
||||
"branches.createTitle": "Создать филиал",
|
||||
"branches.editTitle": "Редактировать филиал",
|
||||
"branches.title": "Филиалы",
|
||||
"branches.actions.create": "Создать филиал",
|
||||
"branches.actions.update": "Обновить филиал",
|
||||
"branches.deleteConfirm": "Вы уверены, что хотите удалить этот филиал?",
|
||||
"branches.form.subtitle": "Заполните все поля и проходите шаг за шагом.",
|
||||
"branches.sections.address": "Адрес и контакты",
|
||||
"branches.sections.basic": "Основная информация",
|
||||
"branches.sections.hours": "Рабочее время",
|
||||
"branches.viewTitle": "Детали филиала",
|
||||
"cardBalance.createTitle": "Создать остаток карты",
|
||||
"cardBalance.editTitle": "Редактировать остаток карты",
|
||||
@@ -706,6 +762,13 @@
|
||||
"cardReasons.createTitle": "Создать причину",
|
||||
"cardReasons.editTitle": "Редактировать причину",
|
||||
"cardReasons.title": "Причины выпуска карт",
|
||||
"cardReasons.actions.create": "Создать причину",
|
||||
"cardReasons.actions.update": "Обновить причину",
|
||||
"cardReasons.deleteConfirm": "Вы уверены, что хотите удалить эту причину?",
|
||||
"cardReasons.fields.description": "ОПИСАНИЕ",
|
||||
"cardReasons.fields.isActive": "АКТИВНЫЙ",
|
||||
"cardReasons.fields.name": "НАЗВАНИЕ",
|
||||
"cardReasons.fields.value": "ЗНАЧЕНИЕ",
|
||||
"cardReasons.viewTitle": "Детали причины",
|
||||
"cardRequisites.createTitle": "Создать реквизиты карты",
|
||||
"cardRequisites.editTitle": "Редактировать реквизиты карты",
|
||||
@@ -714,6 +777,12 @@
|
||||
"cardTypes.createTitle": "Создать тип карты",
|
||||
"cardTypes.editTitle": "Редактировать тип карты",
|
||||
"cardTypes.title": "Типы карт",
|
||||
"cardTypes.actions.create": "Создать тип карты",
|
||||
"cardTypes.deleteConfirm": "Вы уверены, что хотите удалить этот тип карты?",
|
||||
"cardTypes.fields.description": "ОПИСАНИЕ",
|
||||
"cardTypes.fields.isActive": "АКТИВНЫЙ",
|
||||
"cardTypes.fields.name": "НАЗВАНИЕ",
|
||||
"cardTypes.fields.value": "ЗНАЧЕНИЕ",
|
||||
"cardTypes.view.title": "Детали типа карты",
|
||||
"clients.createTitle": "Создать клиента",
|
||||
"clients.editTitle": "Редактировать клиента",
|
||||
@@ -725,6 +794,12 @@
|
||||
"districts.createTitle": "Создать район",
|
||||
"districts.editTitle": "Редактировать район",
|
||||
"districts.title": "Районы",
|
||||
"districts.actions.create": "Создать район",
|
||||
"districts.actions.update": "Обновить район",
|
||||
"districts.deleteConfirm": "Вы уверены, что хотите удалить этот район?",
|
||||
"districts.fields.description": "ПРИМЕЧАНИЯ",
|
||||
"districts.fields.isActive": "АКТИВНЫЙ",
|
||||
"districts.fields.name": "НАЗВАНИЕ",
|
||||
"districts.viewTitle": "Детали района",
|
||||
"intlPayment.createTitle": "Создать платеж Visa/Master",
|
||||
"intlPayment.editTitle": "Редактировать платеж Visa/Master",
|
||||
@@ -738,9 +813,46 @@
|
||||
"loanTypes.createTitle": "Создать тип кредита",
|
||||
"loanTypes.editTitle": "Редактировать тип кредита",
|
||||
"loanTypes.title": "Типы кредитов",
|
||||
"loanTypes.actions.create": "Создать тип кредита",
|
||||
"loanTypes.columns.isActive": "АКТИВНЫЙ",
|
||||
"loanTypes.columns.loanTerm": "СРОК КРЕДИТА",
|
||||
"loanTypes.columns.name": "НАЗВАНИЕ",
|
||||
"loanTypes.columns.notes": "ПРИМЕЧАНИЯ",
|
||||
"loanTypes.columns.tax": "НАЛОГ",
|
||||
"loanTypes.deleteDialog.description": "Вы уверены, что хотите удалить этот тип кредита? Это действие необратимо.",
|
||||
"loanTypes.deleteDialog.title": "Удалить",
|
||||
"loanTypes.fields.isActive": "Активный",
|
||||
"loanTypes.fields.loanTerm": "Срок кредита",
|
||||
"loanTypes.fields.name": "Название",
|
||||
"loanTypes.fields.notes": "Примечания",
|
||||
"loanTypes.fields.tax": "Налог",
|
||||
"loanTypes.actions.save": "Сохранить",
|
||||
"loanTypes.viewTitle": "Детали типа кредита",
|
||||
"notFound": "Не найдено",
|
||||
"onlinePayments.title": "Онлайн-платежи",
|
||||
"onlinePayments.columns.amount": "СУММА",
|
||||
"onlinePayments.columns.apiClient": "API CLIENT",
|
||||
"onlinePayments.columns.description": "DESC",
|
||||
"onlinePayments.columns.status": "СТАТУС",
|
||||
"onlinePayments.columns.username": "USERNAME",
|
||||
"onlinePayments.columns.createdAt": "ДАТА СОЗДАНИЯ",
|
||||
"onlinePayments.actions.callback": "Отправить callback",
|
||||
"onlinePayments.detail.title": "Детали онлайн-платежа",
|
||||
"onlinePayments.notFound": "Платеж не найден",
|
||||
"onlinePayments.fields.amount": "Сумма",
|
||||
"onlinePayments.fields.orderNumber": "Номер заказа",
|
||||
"onlinePayments.fields.apiClient": "API Client",
|
||||
"onlinePayments.fields.description": "Описание",
|
||||
"onlinePayments.fields.orderId": "ID заказа",
|
||||
"onlinePayments.fields.formUrl": "URL формы",
|
||||
"onlinePayments.fields.successUrl": "URL успеха",
|
||||
"onlinePayments.fields.status": "Статус",
|
||||
"onlinePayments.fields.callbackStatus": "Статус callback",
|
||||
"onlinePayments.fields.username": "Имя пользователя",
|
||||
"onlinePayments.fields.onlinePaymantableId": "ID онлайн-таблицы",
|
||||
"onlinePayments.fields.onlinePaymantableType": "Тип онлайн-таблицы",
|
||||
"onlinePayments.fields.createdAt": "Дата создания",
|
||||
"onlinePayments.fields.updatedAt": "Дата обновления",
|
||||
"permissions.createTitle": "Создать разрешение",
|
||||
"permissions.editTitle": "Редактировать разрешение",
|
||||
"permissions.title": "Разрешения",
|
||||
@@ -975,9 +1087,25 @@
|
||||
"intlPayment.status.pending": "В ожидании",
|
||||
"intlPayment.status.approved": "Подтверждено",
|
||||
"intlPayment.status.rejected": "Отклонено",
|
||||
"intlPayment.col.id": "ID",
|
||||
"intlPayment.createdAt": "Дата создания",
|
||||
"intlPayment.firstName": "Имя",
|
||||
"intlPayment.lastName": "Фамилия",
|
||||
"intlPayment.createBtn": "Создать платеж Visa/Master",
|
||||
"permissions.actions.create": "Создать разрешение",
|
||||
"permissions.deleteDialog.description": "Вы уверены, что хотите удалить это разрешение? Это действие необратимо.",
|
||||
"permissions.deleteDialog.title": "Удалить разрешение",
|
||||
"permissions.fields.code": "КОД",
|
||||
"permissions.fields.guardName": "GUARD NAME",
|
||||
"permissions.fields.name": "ИМЯ",
|
||||
"permissions.searchPlaceholder": "Поиск...",
|
||||
"roles.actions.create": "Создать роль",
|
||||
"roles.deleteDialog.description": "Вы уверены, что хотите удалить эту роль? Это действие необратимо.",
|
||||
"roles.deleteDialog.title": "Удалить роль",
|
||||
"roles.fields.code": "КОД",
|
||||
"roles.fields.name": "ИМЯ",
|
||||
"roles.fields.guardName": "GUARD NAME",
|
||||
"roles.fields.name": "ИМЯ",
|
||||
"roles.searchPlaceholder": "Поиск...",
|
||||
"branches.fields.name": "НАЗВАНИЕ",
|
||||
"branches.fields.region": "ВЕЛАЯТ",
|
||||
"branches.fields.district": "РАЙОН",
|
||||
@@ -985,7 +1113,15 @@
|
||||
"branches.fields.isActive": "АКТИВНЫЙ",
|
||||
"branches.fields.billingIbr": "ЛОГИН БИЛЛИНГА (IBR)",
|
||||
"branches.fields.billingSber": "ЛОГИН БИЛЛИНГА (SBER)",
|
||||
"branches.fields.address": "АДРЕС",
|
||||
"branches.fields.billingVisa": "ЛОГИН БИЛЛИНГА (VISA)",
|
||||
"branches.fields.code": "КОД",
|
||||
"branches.fields.description": "ПРИМЕЧАНИЯ",
|
||||
"branches.fields.email": "EMAIL",
|
||||
"branches.fields.phone": "ТЕЛЕФОН",
|
||||
"branches.fields.workingHours": "РАБОЧЕЕ ВРЕМЯ",
|
||||
"users.title": "Все пользователи",
|
||||
"users.searchPlaceholder": "Поиск",
|
||||
"users.createTitle": "Создание пользователя",
|
||||
"users.viewTitle": "Детали пользователя",
|
||||
"users.fields.username": "Имя пользователя",
|
||||
@@ -993,6 +1129,17 @@
|
||||
"users.fields.phone": "Телефон",
|
||||
"users.fields.email": "Email",
|
||||
"users.fields.isActive": "Активный",
|
||||
"users.fields.isActiveHint": "Может ли пользователь войти в систему",
|
||||
"users.fields.usernameHint": "Уникальное имя входа",
|
||||
"users.fields.nameHint": "Полное имя и фамилия",
|
||||
"users.fields.phoneHint": "Начинается с +993",
|
||||
"users.fields.emailHint": "По желанию",
|
||||
"users.fields.password": "Пароль",
|
||||
"users.fields.passwordHint": "Минимум 6 символов",
|
||||
"users.fields.phoneVerified": "Телефон подтвержден",
|
||||
"users.fields.phoneVerifiedHint": "Подтверждено через SMS",
|
||||
"users.actions.create": "Создать пользователя",
|
||||
"users.actions.save": "Сохранить",
|
||||
"users.sections.roles": "Роли",
|
||||
"users.actions.addRole": "Добавить роль",
|
||||
"users.empty.roles": "Ролей по заданным критериям не найдено.",
|
||||
@@ -1015,6 +1162,11 @@
|
||||
"clients.sections.contact": "Контакт",
|
||||
"clients.fields.phone": "Телефон",
|
||||
"clients.fields.email": "Email",
|
||||
"clients.fields.password": "Пароль",
|
||||
"clients.fields.passwordEditHint": "Введите новый пароль для изменения",
|
||||
"clients.fields.passwordEditNote": "Оставьте пустым, чтобы сохранить текущий пароль",
|
||||
"clients.createBtn": "Создать клиента",
|
||||
"clients.updateBtn": "Сохранить изменения",
|
||||
"clients.sections.roles": "Роли",
|
||||
"clients.addRole": "Добавить роль",
|
||||
"clients.noRoles": "Ролей по заданным критериям не найдено.",
|
||||
@@ -1034,5 +1186,34 @@
|
||||
"clients.deleteConfirm": "Вы уверены, что хотите удалить клиента {{name}}?",
|
||||
"languages.tk": "Türkmen",
|
||||
"languages.ru": "Русский",
|
||||
"languages.en": "English"
|
||||
"languages.en": "English",
|
||||
"nav.dashboard": "Главная страница",
|
||||
"nav.settings": "Настройки",
|
||||
"loanOrders.viewTitle": "Детали заявки на кредит",
|
||||
"loanOrderMobiles.viewTitle": "Детали заявки на кредит (Мобильный)",
|
||||
"loanRemaining.viewTitle": "Детали остатка кредита",
|
||||
"loanPaidOffLetters.viewTitle": "Детали справки",
|
||||
"cardOrder.viewTitle": "Детали заказа карты",
|
||||
"cardTransactions.title": "Транзакции карты",
|
||||
"cardTransactions.viewTitle": "Детали транзакции карты",
|
||||
"cardRequisites.title": "Реквизиты карты",
|
||||
"cardRequisites.viewTitle": "Детали реквизита карты",
|
||||
"cardBalance.viewTitle": "Детали остатка карты",
|
||||
"cardPins.title": "ПИН-конверты",
|
||||
"cardPins.viewTitle": "Детали ПИН-конверта",
|
||||
"visaMaster.title": "Платежи Visa/Master",
|
||||
"visaMaster.createTitle": "Создать платёж Visa/Master",
|
||||
"visaMaster.viewTitle": "Детали платежа Visa/Master",
|
||||
"visaMaster.editTitle": "Редактировать платёж Visa/Master",
|
||||
"operators.viewTitle": "Детали оператора",
|
||||
"allUsers.createTitle": "Создать пользователя",
|
||||
"allUsers.viewTitle": "Детали пользователя",
|
||||
"allUsers.editTitle": "Редактировать пользователя",
|
||||
"clients.viewTitle": "Детали клиента",
|
||||
"currencyRates.viewTitle": "Детали курса валют",
|
||||
"visaMasterSberSettings.title": "Настройки Visa/Master, Sber",
|
||||
"visaMasterSberSettings.createTitle": "Создать настройку",
|
||||
"visaMasterSberSettings.editTitle": "Редактировать настройку",
|
||||
"onlinePayments.viewTitle": "Детали платежа",
|
||||
"cardTypes.viewTitle": "Детали типа карты"
|
||||
}
|
||||
@@ -362,6 +362,13 @@
|
||||
"Enter your username to continue": "Dowam etmek üçin ulanyjy adyny giriziň",
|
||||
"Old surname (if changed)": "Köne familiýaňyz (eger üýtgän bolsa)",
|
||||
"common.view": "Görmek",
|
||||
"common.download": "Göçürip al",
|
||||
"audit.columns.id": "ID",
|
||||
"audit.columns.action": "AMALYŇ ADY",
|
||||
"audit.columns.by": "KIM TARAPYNDAN",
|
||||
"audit.columns.target": "AMALYŇ NYŞANY",
|
||||
"audit.columns.status": "AMALYŇ STATUSY",
|
||||
"audit.columns.date": "SENE",
|
||||
"common.edit": "Üýtgetmek",
|
||||
"common.delete": "Pozmak",
|
||||
"common.goBack": "Yza gaýt",
|
||||
@@ -428,7 +435,9 @@
|
||||
"Currency rates": "Walýuta kurslary",
|
||||
"Loan balance": "Karzyň galyndysy",
|
||||
"loanDocuments.title": "Karz gerekli resminamalary",
|
||||
"loanDocuments.viewTitle": "Karz gerekli resminamalary giňişleýin",
|
||||
"loanDocuments.createBtn": "Karz gerekli resminamalary dörediň",
|
||||
"loanDocuments.createTitle": "Karz gerekli resminama dörediň",
|
||||
"loanDocuments.editTitle": "Karz gerekli resminamalary redaktirle",
|
||||
"loanDocuments.columns.name": "ADY",
|
||||
"loanDocuments.deleteConfirm": "Bu resminamany öçürmek isleýärsiňizmi?",
|
||||
@@ -450,6 +459,7 @@
|
||||
"common.save": "Ýatda sakla",
|
||||
"common.create": "Döretmek",
|
||||
"common.loading": "Ýüklenilýär...",
|
||||
"common.form.subtitle": "Ähli meýdanlary dolduryp, ädim-ädim öňe geçiň.",
|
||||
"common.errors.fillRequiredCorrectly": "Dogry maglumat girizmegiňizi haýyş edýäris.",
|
||||
"common.errors.requiredFieldsMissing": "Käbir hökmany meýdanlar doldurylan däldir.",
|
||||
"validation.required": "Hökmany meýdan",
|
||||
@@ -531,6 +541,16 @@
|
||||
"cardOrder.status.pending": "Garaşylýar",
|
||||
"cardOrder.status.approved": "Tassyklandy",
|
||||
"cardOrder.status.rejected": "Ýatyryldy",
|
||||
"cardOrder.col.id": "ID",
|
||||
"cardOrder.col.reason": "Sebäp",
|
||||
"cardOrder.col.createdAt": "Döredilen wagty",
|
||||
"cardOrder.col.cardType": "Görnüşi",
|
||||
"cardOrder.col.province": "Welaýat",
|
||||
"cardOrder.col.branch": "Şahamça",
|
||||
"cardOrder.col.name": "Ady",
|
||||
"cardOrder.col.status": "Status",
|
||||
"cardOrder.create": "Kart sargyt dörediň",
|
||||
"cardOrder.deleteConfirm": "Bu sargyt pozulsynmy?",
|
||||
"citizenship.tm": "Türkmenistan",
|
||||
"citizenship.ru": "Russiýa",
|
||||
"citizenship.other": "Beýlekiler",
|
||||
@@ -560,6 +580,8 @@
|
||||
"cardPin.step.passport": "Pasport",
|
||||
"cardPin.createBtn": "Kart pin bukja dörediň",
|
||||
"cardPin.editBtn": "Kart pin bukja redaktirläň",
|
||||
"cardPin.createTitle": "Kart pin bukja dörediň",
|
||||
"cardPin.editTitle": "Kart pin bukja redaktirläň",
|
||||
"intlPaymentForm.steps.general.title": "Esasy",
|
||||
"intlPaymentForm.steps.general.subtitle": "Status, müşderi",
|
||||
"intlPaymentForm.steps.location.title": "Lokasiýa",
|
||||
@@ -707,9 +729,27 @@
|
||||
"sberPayments.view.delete": "Poz",
|
||||
"allUsers.title": "Ähli müşderiler",
|
||||
"backups.title": "Bekaplar",
|
||||
"backups.create": "Backup dörediň",
|
||||
"backups.col.fileName": "Faýl ady",
|
||||
"backups.col.fileSize": "Ölçegi",
|
||||
"backups.col.status": "Status",
|
||||
"backups.col.createdAt": "Döredilen wagty",
|
||||
"backups.col.createdBy": "Döreden",
|
||||
"backups.status.completed": "Tamamlandy",
|
||||
"backups.status.failed": "Şowsuz",
|
||||
"backups.status.inProgress": "Dowam edýär",
|
||||
"backups.deleteConfirm.title": "Eminsiňizmi?",
|
||||
"backups.deleteConfirm.description": "Bu backup pozulsynmy? Bu amal yzyna gaýtarylmaz.",
|
||||
"branches.createTitle": "Şahamça döretmek",
|
||||
"branches.editTitle": "Şahamça üýtgetmek",
|
||||
"branches.title": "Şahamçalar",
|
||||
"branches.actions.create": "Şahamça döret",
|
||||
"branches.actions.update": "Şahamçany täzelemek",
|
||||
"branches.deleteConfirm": "Bu şahamçany öçürmek isleýärsiňizmi?",
|
||||
"branches.form.subtitle": "Ähli meýdanlary dolduryp, ädim-ädim öň geçiň.",
|
||||
"branches.sections.address": "Salgy we habarlaşmak",
|
||||
"branches.sections.basic": "Esasy maglumatlar",
|
||||
"branches.sections.hours": "Iş wagty",
|
||||
"branches.viewTitle": "Şahamça giňişleýin",
|
||||
"cardBalance.createTitle": "Kart galyndy döretmek",
|
||||
"cardBalance.editTitle": "Kart galyndy üýtgetmek",
|
||||
@@ -722,6 +762,13 @@
|
||||
"cardReasons.createTitle": "Sebäp döretmek",
|
||||
"cardReasons.editTitle": "Sebäp üýtgetmek",
|
||||
"cardReasons.title": "Kart çykarylyş sebäpleri",
|
||||
"cardReasons.actions.create": "Kartyň çykarylmagynyň sebäbini döretdiň",
|
||||
"cardReasons.actions.update": "Sebäbi täzelemek",
|
||||
"cardReasons.deleteConfirm": "Bu kartyň çykarylmagynyň sebäbini öçürmek isleýärsiňizmi?",
|
||||
"cardReasons.fields.description": "BELLIKLER",
|
||||
"cardReasons.fields.isActive": "IŞJEŇ",
|
||||
"cardReasons.fields.name": "ADY",
|
||||
"cardReasons.fields.value": "BAHA",
|
||||
"cardReasons.viewTitle": "Sebäp giňişleýin",
|
||||
"cardRequisites.createTitle": "Kart rekwizit döretmek",
|
||||
"cardRequisites.editTitle": "Kart rekwizit üýtgetmek",
|
||||
@@ -730,6 +777,12 @@
|
||||
"cardTypes.createTitle": "Kart görnüşi döretmek",
|
||||
"cardTypes.editTitle": "Kart görnüşi üýtgetmek",
|
||||
"cardTypes.title": "Kart görnüşleri",
|
||||
"cardTypes.actions.create": "Kart görnüşi döretdiň",
|
||||
"cardTypes.deleteConfirm": "Bu kart görnüşini öçürmek isleýärsiňizmi?",
|
||||
"cardTypes.fields.description": "BELLIKLER",
|
||||
"cardTypes.fields.isActive": "IŞJEŇ",
|
||||
"cardTypes.fields.name": "ADY",
|
||||
"cardTypes.fields.value": "BAHA",
|
||||
"cardTypes.view.title": "Kart görnüşi giňişleýin",
|
||||
"clients.createTitle": "Müşderi döretmek",
|
||||
"clients.editTitle": "Müşderi üýtgetmek",
|
||||
@@ -741,6 +794,12 @@
|
||||
"districts.createTitle": "Etrap döretmek",
|
||||
"districts.editTitle": "Etrap üýtgetmek",
|
||||
"districts.title": "Etraplar",
|
||||
"districts.actions.create": "Etrap döret",
|
||||
"districts.actions.update": "Etraby täzelemek",
|
||||
"districts.deleteConfirm": "Bu etrapy öçürmek isleýärsiňizmi?",
|
||||
"districts.fields.description": "BELLIKLER",
|
||||
"districts.fields.isActive": "IŞJEŇ",
|
||||
"districts.fields.name": "ADY",
|
||||
"districts.viewTitle": "Etrap giňişleýin",
|
||||
"intlPayment.createTitle": "Visa/Master töleg döretmek",
|
||||
"intlPayment.editTitle": "Visa/Master töleg üýtgetmek",
|
||||
@@ -754,9 +813,46 @@
|
||||
"loanTypes.createTitle": "Karz görnüşi döretmek",
|
||||
"loanTypes.editTitle": "Karz görnüşi üýtgetmek",
|
||||
"loanTypes.title": "Karz görnüşleri",
|
||||
"loanTypes.actions.create": "Karz görnüşi dörediň",
|
||||
"loanTypes.columns.isActive": "IŞJEŇ",
|
||||
"loanTypes.columns.loanTerm": "KARZ MÖHLETI",
|
||||
"loanTypes.columns.name": "ADY",
|
||||
"loanTypes.columns.notes": "BELLIKLER",
|
||||
"loanTypes.columns.tax": "SALGYT",
|
||||
"loanTypes.deleteDialog.description": "Bu karz görnüşini pozmak isleýärsiňizmi? Bu amal yzyna gaýtarylyp bilinmez.",
|
||||
"loanTypes.deleteDialog.title": "Pozmak",
|
||||
"loanTypes.fields.isActive": "Işjeň",
|
||||
"loanTypes.fields.loanTerm": "Karz möhleti",
|
||||
"loanTypes.fields.name": "Ady",
|
||||
"loanTypes.fields.notes": "Bellikler",
|
||||
"loanTypes.fields.tax": "Salgyt",
|
||||
"loanTypes.actions.save": "Ýatda sakla",
|
||||
"loanTypes.viewTitle": "Karz görnüşi giňişleýin",
|
||||
"notFound": "Tapylmady",
|
||||
"onlinePayments.title": "Onlaýn töleg taryhy",
|
||||
"onlinePayments.columns.amount": "MÖÇBERI",
|
||||
"onlinePayments.columns.apiClient": "API CLIENT",
|
||||
"onlinePayments.columns.description": "DESC",
|
||||
"onlinePayments.columns.status": "STATUS",
|
||||
"onlinePayments.columns.username": "USERNAME",
|
||||
"onlinePayments.columns.createdAt": "DÖREDILEN WAGTY",
|
||||
"onlinePayments.actions.callback": "Callback ugrat",
|
||||
"onlinePayments.detail.title": "Onlaýn töleg taryhy giňişleýin",
|
||||
"onlinePayments.notFound": "Töleg tapylmady",
|
||||
"onlinePayments.fields.amount": "Möçberi",
|
||||
"onlinePayments.fields.orderNumber": "Order belgisi",
|
||||
"onlinePayments.fields.apiClient": "API Client",
|
||||
"onlinePayments.fields.description": "Düşündiriş",
|
||||
"onlinePayments.fields.orderId": "Order ID",
|
||||
"onlinePayments.fields.formUrl": "Form URL",
|
||||
"onlinePayments.fields.successUrl": "Üstünlik URL",
|
||||
"onlinePayments.fields.status": "Status",
|
||||
"onlinePayments.fields.callbackStatus": "Callback status",
|
||||
"onlinePayments.fields.username": "Ulanyjy ady",
|
||||
"onlinePayments.fields.onlinePaymantableId": "Online öýleg tablisasynyň ID",
|
||||
"onlinePayments.fields.onlinePaymantableType": "Online töleg tablisasynyň görnüşi",
|
||||
"onlinePayments.fields.createdAt": "Döredilen wagty",
|
||||
"onlinePayments.fields.updatedAt": "Üýtgedilen wagty",
|
||||
"permissions.createTitle": "Rugsat döretmek",
|
||||
"permissions.editTitle": "Rugsat üýtgetmek",
|
||||
"permissions.title": "Rugsatlar",
|
||||
@@ -991,9 +1087,25 @@
|
||||
"intlPayment.status.pending": "Garaşylýar",
|
||||
"intlPayment.status.approved": "Tassyklandy",
|
||||
"intlPayment.status.rejected": "Ret edildi",
|
||||
"intlPayment.col.id": "ID",
|
||||
"intlPayment.createdAt": "Döredilen wagty",
|
||||
"intlPayment.firstName": "Ady",
|
||||
"intlPayment.lastName": "Familiýasy",
|
||||
"intlPayment.createBtn": "Visa/Master tölegler (talyplar üçin) dörediň",
|
||||
"roles.actions.create": "Rol dörediň",
|
||||
"roles.deleteDialog.description": "Bu roly pozmak isleýärsiňizmi? Bu amal yzyna gaýtarylmaz.",
|
||||
"roles.deleteDialog.title": "Roly pozmak",
|
||||
"roles.fields.code": "KOD",
|
||||
"roles.fields.name": "ADY",
|
||||
"roles.fields.guardName": "GUARD NAME",
|
||||
"roles.fields.name": "ADY",
|
||||
"roles.searchPlaceholder": "Gözlemek...",
|
||||
"permissions.actions.create": "Rugsat dörediň",
|
||||
"permissions.deleteDialog.description": "Bu rugsady pozmak isleýärsiňizmi? Bu amal yzyna gaýtarylmaz.",
|
||||
"permissions.deleteDialog.title": "Rugsaty pozmak",
|
||||
"permissions.fields.code": "KOD",
|
||||
"permissions.fields.name": "ADY",
|
||||
"permissions.fields.guardName": "GUARD NAME",
|
||||
"permissions.searchPlaceholder": "Gözlemek...",
|
||||
"branches.fields.name": "ADY",
|
||||
"branches.fields.region": "WELAÝAT",
|
||||
"branches.fields.district": "ETRAP",
|
||||
@@ -1001,7 +1113,15 @@
|
||||
"branches.fields.isActive": "IŞJEŇ",
|
||||
"branches.fields.billingIbr": "BILLING ULANYJY ADY",
|
||||
"branches.fields.billingSber": "BILLING USERNAME (SBER)",
|
||||
"branches.fields.address": "SALGY",
|
||||
"branches.fields.billingVisa": "BILLING USERNAME (VISA)",
|
||||
"branches.fields.code": "KOD",
|
||||
"branches.fields.description": "BELLIKLER",
|
||||
"branches.fields.email": "E-POÇTA",
|
||||
"branches.fields.phone": "TELEFON",
|
||||
"branches.fields.workingHours": "IŞ WAGTY",
|
||||
"users.title": "Ähli ulanyjylar",
|
||||
"users.searchPlaceholder": "Gözlemek",
|
||||
"users.createTitle": "Ulanyjy döretmek",
|
||||
"users.viewTitle": "Ulanyjy giňişleýin",
|
||||
"users.fields.username": "Ulanyjy ady",
|
||||
@@ -1009,6 +1129,17 @@
|
||||
"users.fields.phone": "Telefon",
|
||||
"users.fields.email": "E-poçta",
|
||||
"users.fields.isActive": "Işjeň",
|
||||
"users.fields.isActiveHint": "Ulanyjynyň ulgama girip-bilmezligi",
|
||||
"users.fields.usernameHint": "Unikal login ady",
|
||||
"users.fields.nameHint": "Doly ady we familiýasy",
|
||||
"users.fields.phoneHint": "+993 bilen başlanýar",
|
||||
"users.fields.emailHint": "Islege görä",
|
||||
"users.fields.password": "Açar sözi",
|
||||
"users.fields.passwordHint": "Iň az 6 harp",
|
||||
"users.fields.phoneVerified": "Telefon tassyklanan",
|
||||
"users.fields.phoneVerifiedHint": "SMS arkaly tassyklandy",
|
||||
"users.actions.create": "Ulanyjy dörediň",
|
||||
"users.actions.save": "Ýatda sakla",
|
||||
"users.sections.roles": "Rollar",
|
||||
"users.actions.addRole": "Rol birikdiriň",
|
||||
"users.empty.roles": "Berlen kriteriýalara Rol gabat gelmedi.",
|
||||
@@ -1031,6 +1162,11 @@
|
||||
"clients.sections.contact": "Kontakt",
|
||||
"clients.fields.phone": "Telefon",
|
||||
"clients.fields.email": "E-poçta",
|
||||
"clients.fields.password": "Açar sözi",
|
||||
"clients.fields.passwordEditHint": "Üýtgetmek üçin täze açar söz giriziň",
|
||||
"clients.fields.passwordEditNote": "Boş goýsaňyz, açar sözi üýtgemez",
|
||||
"clients.createBtn": "Müşderi döredin",
|
||||
"clients.updateBtn": "Üýtgetmeleri sakla",
|
||||
"clients.sections.roles": "Rollar",
|
||||
"clients.addRole": "Rol birikdiriň",
|
||||
"clients.noRoles": "Berlen kriterýalara Rol gabat gelmedi.",
|
||||
@@ -1050,5 +1186,34 @@
|
||||
"clients.deleteConfirm": "{{name}} müşderisini pozmak isleýärsiňizmi?",
|
||||
"languages.tk": "Türkmen",
|
||||
"languages.ru": "Русский",
|
||||
"languages.en": "English"
|
||||
"languages.en": "English",
|
||||
"nav.dashboard": "Baş sahypa",
|
||||
"nav.settings": "Sazlamalar",
|
||||
"loanOrders.viewTitle": "Karz sargyt giňişleýin",
|
||||
"loanOrderMobiles.viewTitle": "Karz sargyt giňişleýin (Mobile)",
|
||||
"loanRemaining.viewTitle": "Karz galyndy giňişleýin",
|
||||
"loanPaidOffLetters.viewTitle": "Güwanama giňişleýin",
|
||||
"cardOrder.viewTitle": "Kart sargyt giňişleýin",
|
||||
"cardTransactions.title": "Kart hereketleri",
|
||||
"cardTransactions.viewTitle": "Kart hereketi giňişleýin",
|
||||
"cardRequisites.title": "Kart rekwizitler",
|
||||
"cardRequisites.viewTitle": "Kart rekwizit giňişleýin",
|
||||
"cardBalance.viewTitle": "Kart galyndy giňişleýin",
|
||||
"cardPins.title": "Kart pin bukjalar",
|
||||
"cardPins.viewTitle": "Kart pin bukja giňişleýin",
|
||||
"visaMaster.title": "Visa/Master tölegleri",
|
||||
"visaMaster.createTitle": "Visa/Master töleg döretmek",
|
||||
"visaMaster.viewTitle": "Visa/Master töleg giňişleýin",
|
||||
"visaMaster.editTitle": "Visa/Master töleg üýtgetmek",
|
||||
"operators.viewTitle": "Operator giňişleýin",
|
||||
"allUsers.createTitle": "Ulanyjy döretmek",
|
||||
"allUsers.viewTitle": "Ulanyjy giňişleýin",
|
||||
"allUsers.editTitle": "Ulanyjy üýtgetmek",
|
||||
"clients.viewTitle": "Müşderi giňişleýin",
|
||||
"currencyRates.viewTitle": "Walýuta kursy giňişleýin",
|
||||
"visaMasterSberSettings.title": "Visa/Master, Sber sazlamalary",
|
||||
"visaMasterSberSettings.createTitle": "Sazlama döretmek",
|
||||
"visaMasterSberSettings.editTitle": "Sazlama üýtgetmek",
|
||||
"onlinePayments.viewTitle": "Töleg giňišleýin",
|
||||
"cardTypes.viewTitle": "Kart görnüşi giňişleýin"
|
||||
}
|
||||
@@ -21,15 +21,15 @@ import type { Backup, BackupStatus } from '@/features/backups/api/backupsApi'
|
||||
|
||||
const PER_PAGE = 25
|
||||
|
||||
const STATUS_CONFIG: Record<BackupStatus, { label: string; variant: StatusBadgeVariant; icon: React.ElementType }> = {
|
||||
completed: { label: 'Tamamlandy', variant: 'success', icon: CheckCircle2 },
|
||||
failed: { label: 'Şowsuz', variant: 'error', icon: XCircle },
|
||||
in_progress: { label: 'Dowam edýär', variant: 'warning', icon: Clock },
|
||||
}
|
||||
|
||||
function BackupStatusBadge({ status }: { status: BackupStatus }) {
|
||||
const cfg = STATUS_CONFIG[status]
|
||||
return <StatusBadge label={cfg.label} variant={cfg.variant} icon={cfg.icon} />
|
||||
const { t } = useTranslation()
|
||||
const cfg: Record<BackupStatus, { label: string; variant: StatusBadgeVariant; icon: React.ElementType }> = {
|
||||
completed: { label: t('backups.status.completed', 'Tamamlandy'), variant: 'success', icon: CheckCircle2 },
|
||||
failed: { label: t('backups.status.failed', 'Şowsuz'), variant: 'error', icon: XCircle },
|
||||
in_progress: { label: t('backups.status.inProgress', 'Dowam edýär'), variant: 'warning', icon: Clock },
|
||||
}
|
||||
const currentCfg = cfg[status]
|
||||
return <StatusBadge label={currentCfg.label} variant={currentCfg.variant} icon={currentCfg.icon} />
|
||||
}
|
||||
|
||||
export default function BackupsPage() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Download, Eye, Pencil, Trash2 } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Download, Eye, Pencil, Trash2 } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -12,200 +12,197 @@ import {
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import { DataTable, type ColumnDef } from '@/components/dataTable'
|
||||
import { DataTableToolbar, type ColumnMeta } from '@/components/dataTableToolbar'
|
||||
import type { VisibilityState } from '@tanstack/react-table'
|
||||
import {
|
||||
useCardBalances,
|
||||
useDeleteCardBalance,
|
||||
useDownloadCardBalance,
|
||||
} from '@/features/cardBalance/hooks/useCardBalance'
|
||||
import { type CardBalance } from '@/features/cardBalance/api/cardBalanceApi'
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ColumnMeta } from "@/components/dataTableToolbar";
|
||||
import type { VisibilityState } from "@tanstack/react-table";
|
||||
import { useCardBalances, useDeleteCardBalance, useDownloadCardBalance } from "@/features/cardBalance/hooks/useCardBalance";
|
||||
import { type CardBalance } from "@/features/cardBalance/api/cardBalanceApi";
|
||||
|
||||
const PER_PAGE = 25
|
||||
const PER_PAGE = 25;
|
||||
|
||||
export default function CardBalancesPage() {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [perPage, setPerPage] = useState(PER_PAGE)
|
||||
const [search, setSearch] = useState('')
|
||||
const [deleteId, setDeleteId] = useState<number | null>(null)
|
||||
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({})
|
||||
const [columnOrder, setColumnOrder] = useState<string[]>([])
|
||||
const [page, setPage] = useState(1);
|
||||
const [perPage, setPerPage] = useState(PER_PAGE);
|
||||
const [search, setSearch] = useState("");
|
||||
const [deleteId, setDeleteId] = useState<number | null>(null);
|
||||
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({});
|
||||
const [columnOrder, setColumnOrder] = useState<string[]>([]);
|
||||
|
||||
const { data, isLoading } = useCardBalances({ page, per_page: perPage, search })
|
||||
const deleteMutation = useDeleteCardBalance()
|
||||
const downloadMutation = useDownloadCardBalance()
|
||||
const { data, isLoading } = useCardBalances({ page, per_page: perPage, search });
|
||||
const deleteMutation = useDeleteCardBalance();
|
||||
const downloadMutation = useDownloadCardBalance();
|
||||
|
||||
// ── Columns ───────────────────────────────────────────────────────────────
|
||||
|
||||
const columns: ColumnDef<CardBalance>[] = [
|
||||
{
|
||||
id: 'id',
|
||||
accessorKey: 'id',
|
||||
header: t('ID', 'ID'),
|
||||
id: "id",
|
||||
accessorKey: "id",
|
||||
header: t("ID", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<button
|
||||
className="text-primary font-medium hover:underline"
|
||||
onClick={() => navigate(`/card-balances/${row.original.id}`)}
|
||||
>
|
||||
<button className="text-primary font-medium hover:underline" onClick={() => navigate(`/card-balances/${row.original.id}`)}>
|
||||
{row.original.id}
|
||||
</button>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'passport_series',
|
||||
accessorKey: 'passport_series',
|
||||
header: t('Passport series', 'PASPORT SERIYASY'),
|
||||
id: "passport_series",
|
||||
accessorKey: "passport_series",
|
||||
header: t("Passport series", "PASPORT SERIYASY"),
|
||||
cell: ({ row }) => <span>{row.original.passport_series}</span>,
|
||||
},
|
||||
{
|
||||
id: 'passport_number',
|
||||
accessorKey: 'passport_number',
|
||||
header: t('Passport number', 'PASPORT BELGISI'),
|
||||
id: "passport_number",
|
||||
accessorKey: "passport_number",
|
||||
header: t("Passport number", "PASPORT BELGISI"),
|
||||
cell: ({ row }) => <span>{row.original.passport_number}</span>,
|
||||
},
|
||||
{
|
||||
id: 'card_number',
|
||||
accessorKey: 'card_number',
|
||||
header: t('Card number', 'KART BELGISI'),
|
||||
id: "card_number",
|
||||
accessorKey: "card_number",
|
||||
header: t("Card number", "KART BELGISI"),
|
||||
cell: ({ row }) => <span className="font-mono">{row.original.card_number}</span>,
|
||||
},
|
||||
{
|
||||
id: 'card_expiry_month',
|
||||
accessorKey: 'card_expiry_month',
|
||||
header: t('Expiry month', 'KART MÖHLETI (AÝ)'),
|
||||
id: "card_expiry_month",
|
||||
accessorKey: "card_expiry_month",
|
||||
header: t("Expiry month", "KART MÖHLETI (AÝ)"),
|
||||
cell: ({ row }) => <span>{row.original.card_expiry_month}</span>,
|
||||
},
|
||||
{
|
||||
id: 'card_expiry_year',
|
||||
accessorKey: 'card_expiry_year',
|
||||
header: t('Expiry year', 'KART MÖHLETI (ÝYL)'),
|
||||
id: "card_expiry_year",
|
||||
accessorKey: "card_expiry_year",
|
||||
header: t("Expiry year", "KART MÖHLETI (ÝYL)"),
|
||||
cell: ({ row }) => <span>{row.original.card_expiry_year}</span>,
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
header: '',
|
||||
id: "actions",
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
variant="ghost" size="icon" className="h-7 w-7"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => downloadMutation.mutate(row.original.id)}
|
||||
title={t('Download', 'Ýükle')}
|
||||
title={t("Download", "Ýükle")}
|
||||
>
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost" size="icon" className="h-7 w-7"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => navigate(`/card-balances/${row.original.id}`)}
|
||||
title={t('View', 'Görmek')}
|
||||
title={t("View", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost" size="icon" className="h-7 w-7"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => navigate(`/card-balances/${row.original.id}/edit`)}
|
||||
title={t('Edit', 'Üýtgetmek')}
|
||||
title={t("Edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost" size="icon"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t('Delete', 'Öçürmek')}
|
||||
title={t("Delete", "Öçürmek")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
const columnMeta: ColumnMeta[] = columns
|
||||
.filter((c) => c.id !== 'actions')
|
||||
.filter((c) => c.id !== "actions")
|
||||
.map((c) => ({
|
||||
id: c.id!,
|
||||
label: typeof c.header === 'string' ? c.header : c.id!,
|
||||
}))
|
||||
label: typeof c.header === "string" ? c.header : c.id!,
|
||||
}));
|
||||
|
||||
const total = data?.total ?? 0
|
||||
const totalPages = Math.ceil(total / perPage)
|
||||
const total = data?.total ?? 0;
|
||||
const totalPages = Math.ceil(total / perPage);
|
||||
|
||||
const handleDelete = async () => {
|
||||
if (deleteId === null) return
|
||||
await deleteMutation.mutateAsync(deleteId)
|
||||
setDeleteId(null)
|
||||
}
|
||||
if (deleteId === null) return;
|
||||
await deleteMutation.mutateAsync(deleteId);
|
||||
setDeleteId(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
{t('Card balances', 'Kart galyndylary')}
|
||||
</h1>
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("Card balances", "Kart galyndylary")}</h1>
|
||||
</div>
|
||||
<div className="bg-card border border-border rounded-xl p-4">
|
||||
<div className="bg-card border border-border rounded-xl p-4">
|
||||
<DataTableToolbar
|
||||
searchValue={search}
|
||||
onSearchChange={(v) => {
|
||||
setSearch(v);
|
||||
setPage(1);
|
||||
}}
|
||||
searchPlaceholder={t("common.search", "Gözlemek")}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
actionLabel={t("Create card balance", "Kart galyndysy dörediň")}
|
||||
onAction={() => navigate("/card-balances/create")}
|
||||
perPageOptions={[10, 25, 50, 100]}
|
||||
perPage={perPage}
|
||||
onPerPageChange={(v) => {
|
||||
setPerPage(v);
|
||||
setPage(1);
|
||||
}}
|
||||
/>
|
||||
|
||||
<DataTableToolbar
|
||||
searchValue={search}
|
||||
onSearchChange={(v) => { setSearch(v); setPage(1) }}
|
||||
searchPlaceholder={t('Search', 'Gözlemek')}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
actionLabel={t('Create card balance', 'Kart galyndysy dörediň')}
|
||||
onAction={() => navigate('/card-balances/create')}
|
||||
perPageOptions={[10, 25, 50, 100]}
|
||||
perPage={perPage}
|
||||
onPerPageChange={(v) => { setPerPage(v); setPage(1) }}
|
||||
/>
|
||||
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={data?.data ?? []}
|
||||
isLoading={isLoading}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
enableRowSelection
|
||||
getRowId={(row) => String(row.id)}
|
||||
currentPage={page}
|
||||
totalPages={totalPages}
|
||||
totalCount={total}
|
||||
onPageChange={setPage}
|
||||
/>
|
||||
</div>
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={data?.data ?? []}
|
||||
isLoading={isLoading}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
enableRowSelection
|
||||
getRowId={(row) => String(row.id)}
|
||||
currentPage={page}
|
||||
totalPages={totalPages}
|
||||
totalCount={total}
|
||||
onPageChange={setPage}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AlertDialog open={deleteId !== null} onOpenChange={(open) => !open && setDeleteId(null)}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>{t('Are you sure?', 'Eminsiňizmi?')}</AlertDialogTitle>
|
||||
<AlertDialogTitle>{t("Are you sure?", "Eminsiňizmi?")}</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
{t(
|
||||
'This action cannot be undone.',
|
||||
'Bu amal yzyna gaýtarylmaz. Kart galyndysy hemişelik öçüriler.',
|
||||
)}
|
||||
{t("This action cannot be undone.", "Bu amal yzyna gaýtarylmaz. Kart galyndysy hemişelik öçüriler.")}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>{t('Cancel', 'Ýatyr')}</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={handleDelete}
|
||||
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
||||
>
|
||||
{deleteMutation.isPending ? t('Deleting...', 'Öçürilýär...') : t('Delete', 'Öçür')}
|
||||
<AlertDialogCancel>{t("Cancel", "Ýatyr")}</AlertDialogCancel>
|
||||
<AlertDialogAction onClick={handleDelete} className="bg-destructive text-destructive-foreground hover:bg-destructive/90">
|
||||
{deleteMutation.isPending ? t("Deleting...", "Öçürilýär...") : t("Delete", "Öçür")}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { useParams, useNavigate, Link } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Download, Trash2, Pencil, ChevronDown } from "lucide-react";
|
||||
import { Download, Trash2, Pencil } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
@@ -19,7 +19,9 @@ import {
|
||||
useDeleteCardBalance,
|
||||
useDownloadCardBalance,
|
||||
} from "@/features/cardBalance/hooks/useCardBalance";
|
||||
import { InfoRow } from "@/components/viewPageComponents";
|
||||
import { InfoRow, CollapsibleSection, StatusBadge, EmptyState } from "@/components/viewPageComponents";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
|
||||
// ─── Types for operations table ───────────────────────────────────────────────
|
||||
|
||||
@@ -32,25 +34,6 @@ interface Operation {
|
||||
date: string;
|
||||
}
|
||||
|
||||
// ─── Status badge ─────────────────────────────────────────────────────────────
|
||||
|
||||
const STATUS_STYLES: Record<string, string> = {
|
||||
FINISHED: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",
|
||||
PENDING: "bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",
|
||||
FAILED: "bg-red-500/20 text-red-400 border border-red-500/30",
|
||||
};
|
||||
|
||||
function OpStatusBadge({ status }: { status: string }) {
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold ${STATUS_STYLES[status] ?? STATUS_STYLES.PENDING}`}
|
||||
>
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-current" />
|
||||
{status}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function CardBalanceViewPage() {
|
||||
@@ -59,8 +42,7 @@ export default function CardBalanceViewPage() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [deleteOpen, setDeleteOpen] = useState(false);
|
||||
const [opsExpanded, setOpsExpanded] = useState(true);
|
||||
const [opsPage, setOpsPage] = useState(1);
|
||||
const [opsSearch, setOpsSearch] = useState("");
|
||||
|
||||
const numericId = Number(id);
|
||||
const { data, isLoading } = useCardBalance(numericId);
|
||||
@@ -69,7 +51,58 @@ export default function CardBalanceViewPage() {
|
||||
|
||||
// Placeholder operations — in real app fetch from API using numericId
|
||||
const operations: Operation[] = [];
|
||||
const opsTotal = operations.length;
|
||||
|
||||
const filteredOperations = operations.filter(
|
||||
(op) =>
|
||||
op.action_name.toLowerCase().includes(opsSearch.toLowerCase()) ||
|
||||
op.target.toLowerCase().includes(opsSearch.toLowerCase()),
|
||||
);
|
||||
|
||||
// ── Operations columns ──────────────────────────────────────────────────
|
||||
|
||||
const operationColumns: ColumnDef<Operation>[] = [
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: t("ID", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold text-sm">
|
||||
{row.original.id}
|
||||
</span>
|
||||
),
|
||||
size: 80,
|
||||
},
|
||||
{
|
||||
accessorKey: "action_name",
|
||||
header: t("Action name", "AMALYŇ ADY"),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.action_name}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "performed_by",
|
||||
header: t("Performed by", "KIM TARAPYNDAN"),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.performed_by}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "target",
|
||||
header: t("Target", "AMALYŇ NYŞANY (TARGEDI)"),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.target}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "status",
|
||||
header: t("Status", "AMALYŇ STATUSY"),
|
||||
cell: ({ row }) => <StatusBadge status={row.original.status} />,
|
||||
size: 160,
|
||||
},
|
||||
{
|
||||
accessorKey: "date",
|
||||
header: t("Date", "SENE"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm text-muted-foreground whitespace-nowrap">
|
||||
{row.original.date}
|
||||
</span>
|
||||
),
|
||||
size: 160,
|
||||
},
|
||||
];
|
||||
|
||||
const handleDelete = async () => {
|
||||
await deleteMutation.mutateAsync(numericId);
|
||||
@@ -158,100 +191,33 @@ export default function CardBalanceViewPage() {
|
||||
</div>
|
||||
|
||||
{/* Ammallar (Operations) collapsible section */}
|
||||
<div className="rounded-lg border border-border bg-card overflow-hidden">
|
||||
{/* Section toggle header */}
|
||||
<button
|
||||
className="w-full flex items-center gap-2 px-4 py-3 text-left hover:bg-muted/20 transition-colors"
|
||||
onClick={() => setOpsExpanded((v) => !v)}
|
||||
>
|
||||
<span className="font-semibold text-foreground text-sm">
|
||||
{t("Operations", "Ammallar")}
|
||||
</span>
|
||||
<ChevronDown
|
||||
size={15}
|
||||
className={`text-muted-foreground transition-transform duration-200 ${opsExpanded ? "rotate-180" : ""}`}
|
||||
<CollapsibleSection title={t("Operations", "Ammallar")}>
|
||||
<DataTableToolbar
|
||||
searchValue={opsSearch}
|
||||
onSearchChange={setOpsSearch}
|
||||
searchPlaceholder={t("common.search", "Gözlemek")}
|
||||
columns={[]}
|
||||
columnVisibility={{}}
|
||||
onColumnVisibilityChange={() => {}}
|
||||
columnOrder={[]}
|
||||
onColumnOrderChange={() => {}}
|
||||
/>
|
||||
{filteredOperations.length === 0 ? (
|
||||
<EmptyState
|
||||
label={t(
|
||||
"No operations found",
|
||||
"Berlen kriterýalara Amal gabat gelmedi.",
|
||||
)}
|
||||
/>
|
||||
) : (
|
||||
<DataTable
|
||||
columns={operationColumns}
|
||||
data={filteredOperations}
|
||||
getRowId={(r) => String(r.id)}
|
||||
enableRowSelection
|
||||
/>
|
||||
</button>
|
||||
|
||||
{opsExpanded && (
|
||||
<>
|
||||
<div className="overflow-x-auto border-t border-border">
|
||||
<table className="w-full text-sm">
|
||||
<thead>
|
||||
<tr className="bg-muted/30 border-b border-border">
|
||||
{[
|
||||
t("ID", "ID"),
|
||||
t("Action name", "AMALYŇ ADY"),
|
||||
t("Performed by", "KIM TARAPYNDAN"),
|
||||
t("Target", "AMALYŇ NYŞANY (TARGEDI)"),
|
||||
t("Status", "AMALYŇ STATUSY"),
|
||||
t("Date", "SENE"),
|
||||
].map((h) => (
|
||||
<th
|
||||
key={h}
|
||||
className="text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wide whitespace-nowrap"
|
||||
>
|
||||
{h}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{operations.length === 0 ? (
|
||||
<tr>
|
||||
<td
|
||||
colSpan={6}
|
||||
className="text-center py-10 text-muted-foreground text-sm"
|
||||
>
|
||||
{t("No operations found", "Amal tapylmady")}
|
||||
</td>
|
||||
</tr>
|
||||
) : (
|
||||
operations.map((op) => (
|
||||
<tr
|
||||
key={op.id}
|
||||
className="border-b border-border/50 hover:bg-muted/20 transition-colors"
|
||||
>
|
||||
<td className="px-4 py-3 text-primary font-medium">
|
||||
{op.id}
|
||||
</td>
|
||||
<td className="px-4 py-3">{op.action_name}</td>
|
||||
<td className="px-4 py-3">{op.performed_by}</td>
|
||||
<td className="px-4 py-3">{op.target}</td>
|
||||
<td className="px-4 py-3">
|
||||
<OpStatusBadge status={op.status} />
|
||||
</td>
|
||||
<td className="px-4 py-3 text-muted-foreground">
|
||||
{op.date}
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{/* Ops pagination */}
|
||||
<div className="flex items-center justify-between px-4 py-2.5 border-t border-border text-sm text-muted-foreground">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={opsPage <= 1}
|
||||
onClick={() => setOpsPage((p) => p - 1)}
|
||||
>
|
||||
{t("Previous", "Öňki")}
|
||||
</Button>
|
||||
<span>
|
||||
{opsTotal === 0 ? "0" : `1–${opsTotal}`} {t("of", "of")}{" "}
|
||||
{opsTotal}
|
||||
</span>
|
||||
<Button variant="ghost" size="sm" disabled={true}>
|
||||
{t("Next", "Indiki")}
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</CollapsibleSection>
|
||||
|
||||
{/* Delete dialog */}
|
||||
<AlertDialog open={deleteOpen} onOpenChange={setDeleteOpen}>
|
||||
|
||||
@@ -219,7 +219,7 @@ export default function CardPinsPage() {
|
||||
setSearch(v);
|
||||
setPage(1);
|
||||
}}
|
||||
searchPlaceholder={t("cardPin.search", "Gözlemek")}
|
||||
searchPlaceholder={t('common.search', 'Gözlemek')}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
|
||||
@@ -233,14 +233,14 @@ export default function CardRequisitesPage() {
|
||||
setSearch(v);
|
||||
setPage(1);
|
||||
}}
|
||||
searchPlaceholder={t("Search", "Gözlemek")}
|
||||
searchPlaceholder={t('common.search', 'Gözlemek')}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
actionLabel={t(
|
||||
"Create card requisite order",
|
||||
"cardRequisites.createTitle",
|
||||
"Kart rekwiziti üçin sargyt dörediň",
|
||||
)}
|
||||
onAction={() => navigate("/card-requisites/create")}
|
||||
|
||||
@@ -164,7 +164,7 @@ export default function CardTransactionsPage() {
|
||||
<DataTableToolbar
|
||||
searchValue={search}
|
||||
onSearchChange={(v) => { setSearch(v); setPage(1) }}
|
||||
searchPlaceholder={t('Search', 'Gözlemek')}
|
||||
searchPlaceholder={t('common.search', 'Gözlemek')}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
|
||||
@@ -19,27 +19,15 @@ import { ConfirmDialog } from '@/components/confirmDialog'
|
||||
|
||||
// ─── Status badge ─────────────────────────────────────────────────────────────
|
||||
|
||||
const STATUS_CONFIG = {
|
||||
PENDING: {
|
||||
label: 'Garaşylýar',
|
||||
variant: 'warning' as StatusBadgeVariant,
|
||||
icon: AlertCircle,
|
||||
},
|
||||
APPROVED: {
|
||||
label: 'Tassyklandy',
|
||||
variant: 'success' as StatusBadgeVariant,
|
||||
icon: CheckCircle2,
|
||||
},
|
||||
REJECTED: {
|
||||
label: 'Ýatyryldy',
|
||||
variant: 'error' as StatusBadgeVariant,
|
||||
icon: XCircle,
|
||||
},
|
||||
} satisfies Record<CardOrderStatus, { label: string; variant: StatusBadgeVariant; icon: React.ElementType }>
|
||||
|
||||
function OrderNewCardStatusBadge({ status }: { status: CardOrderStatus }) {
|
||||
const { t } = useTranslation()
|
||||
const STATUS_CONFIG = {
|
||||
PENDING: { label: t('cardOrder.status.pending', 'Garaşylýar'), variant: 'warning' as StatusBadgeVariant, icon: AlertCircle },
|
||||
APPROVED: { label: t('cardOrder.status.approved', 'Tassyklandy'), variant: 'success' as StatusBadgeVariant, icon: CheckCircle2 },
|
||||
REJECTED: { label: t('cardOrder.status.rejected', 'Ýatyryldy'), variant: 'error' as StatusBadgeVariant, icon: XCircle },
|
||||
}
|
||||
const cfg = STATUS_CONFIG[status]
|
||||
if (!cfg) return <span className="text-xs text-muted-foreground">{String(status)}</span>
|
||||
if (!cfg) return <span className="text-xs text-muted-foreground">{status}</span>
|
||||
return <StatusBadge label={cfg.label} variant={cfg.variant} icon={cfg.icon} />
|
||||
}
|
||||
|
||||
@@ -55,26 +43,11 @@ function HighlightText({ value, variant }: { value: string; variant: 'teal' | 'c
|
||||
return <span className={cls}>{value}</span>
|
||||
}
|
||||
|
||||
// ─── Column meta (toolbar toggle) ────────────────────────────────────────────
|
||||
|
||||
const COLUMN_META = [
|
||||
{ id: 'id', label: 'ID' },
|
||||
{ id: 'issuanceReasonName', label: 'Sebäp' },
|
||||
{ id: 'createdAt', label: 'Döredilen wagty' },
|
||||
{ id: 'cardTypeName', label: 'Görnüşi' },
|
||||
{ id: 'provinceName', label: 'Welaýat' },
|
||||
{ id: 'branchName', label: 'Şahamça' },
|
||||
{ id: 'fullName', label: 'Ady' },
|
||||
{ id: 'status', label: 'Status' },
|
||||
]
|
||||
|
||||
const SPECIAL_BRANCHES = [
|
||||
'Köpetdag', 'Türkmenabat', 'Türkmenbaşy',
|
||||
'Seýdi', 'Çandybil', 'Balkan', 'Baş bank',
|
||||
]
|
||||
|
||||
const DEFAULT_ORDER = COLUMN_META.map((c) => c.id)
|
||||
|
||||
// ─── CardOrdersPage ───────────────────────────────────────────────────────────
|
||||
|
||||
export default function CardOrdersPage() {
|
||||
@@ -83,6 +56,22 @@ export default function CardOrdersPage() {
|
||||
const deleteMutation = useDeleteCardOrder()
|
||||
const [deleteId, setDeleteId] = useState<string | null>(null)
|
||||
|
||||
// ── Column meta (toolbar toggle) ──────────────────────────────────────────
|
||||
const COLUMN_META = useMemo(
|
||||
() => [
|
||||
{ id: 'id', label: t('cardOrder.col.id', 'ID') },
|
||||
{ id: 'issuanceReasonName', label: t('cardOrder.col.reason', 'Sebäp') },
|
||||
{ id: 'createdAt', label: t('cardOrder.col.createdAt', 'Döredilen wagty') },
|
||||
{ id: 'cardTypeName', label: t('cardOrder.col.cardType', 'Görnüşi') },
|
||||
{ id: 'provinceName', label: t('cardOrder.col.province', 'Welaýat') },
|
||||
{ id: 'branchName', label: t('cardOrder.col.branch', 'Şahamça') },
|
||||
{ id: 'fullName', label: t('cardOrder.col.name', 'Ady') },
|
||||
{ id: 'status', label: t('cardOrder.col.status', 'Status') },
|
||||
],
|
||||
[t]
|
||||
)
|
||||
const DEFAULT_ORDER = useMemo(() => COLUMN_META.map((c) => c.id), [COLUMN_META])
|
||||
|
||||
// ── State ──────────────────────────────────────────────────────────────────
|
||||
const [search, setSearch] = useState('')
|
||||
const [page, setPage] = useState(1)
|
||||
|
||||
@@ -12,31 +12,7 @@ import { ConfirmDialog } from '@/components/confirmDialog'
|
||||
import { MonthSelect } from '@/components/monthSelect'
|
||||
import { StatusBadge, type StatusBadgeVariant } from '@/components/ui/statusBadge'
|
||||
import { AlertCircle, CheckCircle2, XCircle } from 'lucide-react'
|
||||
// ─── Status badge ─────────────────────────────────────────────────────────────
|
||||
|
||||
const STATUS_CONFIG = {
|
||||
pending: {
|
||||
label: 'Garaşylýar',
|
||||
variant: 'warning' as StatusBadgeVariant,
|
||||
icon: AlertCircle,
|
||||
},
|
||||
approved: {
|
||||
label: 'Tassyklandy',
|
||||
variant: 'success' as StatusBadgeVariant,
|
||||
icon: CheckCircle2,
|
||||
},
|
||||
rejected: {
|
||||
label: 'Ýatyryldy',
|
||||
variant: 'error' as StatusBadgeVariant,
|
||||
icon: XCircle,
|
||||
},
|
||||
} satisfies Record<IntlPaymentStatus, { label: string; variant: StatusBadgeVariant; icon: React.ElementType }>
|
||||
|
||||
function IntlPaymentStatusStatusBadge({ status }: { status: IntlPaymentStatus }) {
|
||||
const cfg = STATUS_CONFIG[status]
|
||||
if (!cfg) return <span className="text-xs text-muted-foreground">{String(status)}</span>
|
||||
return <StatusBadge label={cfg.label} variant={cfg.variant} icon={cfg.icon} />
|
||||
}
|
||||
// ─── Status badge (defined inside component for t() access) ───────────────────
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -58,10 +34,21 @@ export default function IntlPaymentsPage() {
|
||||
const { data, isLoading } = useIntlPayments({ page, per_page: perPage, search, status: statusFilter, month })
|
||||
const { mutate: deletePayment, isPending: isDeleting } = useDeleteIntlPayment()
|
||||
|
||||
function IntlPaymentStatusBadge({ status }: { status: IntlPaymentStatus }) {
|
||||
const STATUS_CONFIG = {
|
||||
pending: { label: t('intlPayment.status.pending', 'Garaşylýar'), variant: 'warning' as StatusBadgeVariant, icon: AlertCircle },
|
||||
approved: { label: t('intlPayment.status.approved', 'Tassyklandy'), variant: 'success' as StatusBadgeVariant, icon: CheckCircle2 },
|
||||
rejected: { label: t('intlPayment.status.rejected', 'Ret edildi'), variant: 'error' as StatusBadgeVariant, icon: XCircle },
|
||||
}
|
||||
const cfg = STATUS_CONFIG[status]
|
||||
if (!cfg) return <span className="text-xs text-muted-foreground">{status}</span>
|
||||
return <StatusBadge label={cfg.label} variant={cfg.variant} icon={cfg.icon} />
|
||||
}
|
||||
|
||||
const columns: ColumnDef<IntlPaymentItem>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('intlPayment.col.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="font-mono text-xs text-muted-foreground">{row.original.id}</span>
|
||||
),
|
||||
@@ -109,7 +96,7 @@ export default function IntlPaymentsPage() {
|
||||
{
|
||||
accessorKey: 'status',
|
||||
header: t('intlPayment.status', 'Status'),
|
||||
cell: ({ row }) => <IntlPaymentStatusStatusBadge status={row.original.status} />,
|
||||
cell: ({ row }) => <IntlPaymentStatusBadge status={row.original.status} />,
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
@@ -176,9 +163,9 @@ export default function IntlPaymentsPage() {
|
||||
id: 'status',
|
||||
label: t('intlPayment.status', 'Status'),
|
||||
options: [
|
||||
{ value: 'pending', label: 'Garaşylýar' },
|
||||
{ value: 'approved', label: 'Tassyklandy' },
|
||||
{ value: 'rejected', label: 'Ret edildi' },
|
||||
{ value: 'pending', label: t('intlPayment.status.pending', 'Garaşylýar') },
|
||||
{ value: 'approved', label: t('intlPayment.status.approved', 'Tassyklandy') },
|
||||
{ value: 'rejected', label: t('intlPayment.status.rejected', 'Ret edildi') },
|
||||
],
|
||||
},
|
||||
]}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Section, InfoRow } from "@/components/viewPageComponents";
|
||||
import { useGetOnlinePaymentById } from "@/features/onlinePaymentHistory/hooks/useOnlinePaymentsHistory";
|
||||
import { PaymentStatusBadge } from "../../features/onlinePaymentHistory/components/PaymentStatusBadge";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
// ─── OnlinePaymentDetailPage ──────────────────────────────────────────────────
|
||||
|
||||
@@ -20,8 +21,8 @@ export default function OnlinePaymentDetailPage() {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="p-6 space-y-4">
|
||||
<div className="h-6 w-96 bg-muted rounded animate-pulse" />
|
||||
<div className="h-[560px] bg-muted rounded-xl animate-pulse" />
|
||||
<Skeleton className="h-6 w-96" />
|
||||
<Skeleton className="h-[560px] w-full rounded-xl" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -41,14 +42,14 @@ export default function OnlinePaymentDetailPage() {
|
||||
// ─── Render ───────────────────────────────────────────────────────────────
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-foreground mb-6 break-all">
|
||||
{title}
|
||||
</h1>
|
||||
|
||||
{/* Detail Card */}
|
||||
<Section>
|
||||
<InfoRow label="ID" value={payment.id} />
|
||||
<InfoRow label={t("common.id", "ID")} value={payment.id} />
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.amount", "amount")}
|
||||
value={payment.amount}
|
||||
|
||||
@@ -68,7 +68,7 @@ export function CardTypesListPage() {
|
||||
const columns: ColumnDef<CardType>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-mono text-sm font-medium">{row.original.id}</span>
|
||||
),
|
||||
|
||||
@@ -55,7 +55,7 @@ export function CardReasonsListPage() {
|
||||
const filterFields: FilterField[] = [
|
||||
{
|
||||
id: 'isActive',
|
||||
label: t('CardReasons.fields.isActive', 'Işjeň'),
|
||||
label: t('cardReasons.fields.isActive', 'Işjeň'),
|
||||
options: [
|
||||
{ value: 'true', label: t('common.active', 'Işjeň') },
|
||||
{ value: 'false', label: t('common.inactive', 'Işjeň däl') },
|
||||
@@ -79,7 +79,7 @@ export function CardReasonsListPage() {
|
||||
const columns: ColumnDef<CardReason>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-mono text-sm font-medium">
|
||||
{row.original.id}
|
||||
@@ -90,14 +90,14 @@ export function CardReasonsListPage() {
|
||||
{
|
||||
accessorKey: 'name',
|
||||
id: 'name',
|
||||
header: t('CardReasons.fields.name', 'ADY').toUpperCase(),
|
||||
header: t('cardReasons.fields.name', 'ADY').toUpperCase(),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm text-foreground">{row.original.name[lang]}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: 'value',
|
||||
header: t('CardReasons.fields.value', 'BAHA').toUpperCase(),
|
||||
header: t('cardReasons.fields.value', 'BAHA').toUpperCase(),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm text-foreground">{row.original.value}</span>
|
||||
),
|
||||
@@ -105,7 +105,7 @@ export function CardReasonsListPage() {
|
||||
},
|
||||
{
|
||||
accessorKey: 'description',
|
||||
header: t('CardReasons.fields.description', 'BELLIKLER').toUpperCase(),
|
||||
header: t('cardReasons.fields.description', 'BELLIKLER').toUpperCase(),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{row.original.description ?? '—'}
|
||||
@@ -115,7 +115,7 @@ export function CardReasonsListPage() {
|
||||
{
|
||||
accessorKey: 'isActive',
|
||||
id: 'isActive',
|
||||
header: t('CardReasons.fields.isActive', 'IŞJEŇ').toUpperCase(),
|
||||
header: t('cardReasons.fields.isActive', 'IŞJEŇ').toUpperCase(),
|
||||
cell: ({ row }) =>
|
||||
row.original.isActive ? (
|
||||
<CheckCircle2 size={18} className="text-emerald-500" />
|
||||
@@ -176,7 +176,7 @@ export function CardReasonsListPage() {
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{t('CardReasons.title', 'Kartyň çykarylmagynyň sebäpleri')}
|
||||
{t('cardReasons.title', 'Kartyň çykarylmagynyň sebäpleri')}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,7 +198,7 @@ export function CardReasonsListPage() {
|
||||
onFilterReset={handleFilterReset}
|
||||
perPage={perPage}
|
||||
onPerPageChange={(v) => { setPerPage(v); setPage(1) }}
|
||||
actionLabel={t('CardReasons.actions.create', 'Kartyň çykarylmagynyň sebäbini döretdiň')}
|
||||
actionLabel={t('cardReasons.actions.create', 'Kartyň çykarylmagynyň sebäbini döretdiň')}
|
||||
onAction={() => navigate('/settings/card/card-reasons/create')}
|
||||
/>
|
||||
|
||||
@@ -228,7 +228,7 @@ export function CardReasonsListPage() {
|
||||
{t('common.confirmDelete', 'Öçürmegi tassyklaň')}
|
||||
</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
{t('CardReasons.deleteConfirm', 'Bu kartyň çykarylmagynyň sebäbini öçürmek isleýärsiňizmi?')}
|
||||
{t('cardReasons.deleteConfirm', 'Bu kartyň çykarylmagynyň sebäbini öçürmek isleýärsiňizmi?')}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
|
||||
@@ -41,7 +41,7 @@ export function CardReasonViewPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{isLoading
|
||||
? '...'
|
||||
: `${t('CardReasons.view.title', 'Kartyň çykarylmagynyň sebäbi giňişleýin')}: ${data?.name[lang] ?? ''}`}
|
||||
: `${t('cardReasons.viewTitle', 'Kartyň çykarylmagynyň sebäbi giňişleýin')}: ${data?.name[lang] ?? ''}`}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -80,23 +80,23 @@ export function CardReasonViewPage() {
|
||||
</div>
|
||||
) : data ? (
|
||||
<Section>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
|
||||
<MultiLangRow label={t('CardReasons.fields.name', 'Ady')} value={data.name} />
|
||||
<MultiLangRow label={t('cardReasons.fields.name', 'Ady')} value={data.name} />
|
||||
|
||||
<InfoRow
|
||||
label={t('CardReasons.fields.value', 'Baha')}
|
||||
label={t('cardReasons.fields.value', 'Baha')}
|
||||
value={data.value}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t('CardReasons.fields.description', 'Bellikler')}
|
||||
label={t('cardReasons.fields.description', 'Bellikler')}
|
||||
value={data.description ?? undefined}
|
||||
/>
|
||||
|
||||
{/* isActive custom row */}
|
||||
<div className="flex flex-col sm:grid sm:grid-cols-[minmax(0,42%)_minmax(0,58%)] items-start sm:items-center py-2.5 px-4 gap-1 sm:gap-0">
|
||||
<span className="text-xs sm:text-sm text-muted-foreground leading-snug">
|
||||
{t('CardReasons.fields.isActive', 'Işjeň')}
|
||||
{t('cardReasons.fields.isActive', 'Işjeň')}
|
||||
</span>
|
||||
{data.isActive ? (
|
||||
<CheckCircle2 size={18} className="text-emerald-500" />
|
||||
@@ -115,7 +115,7 @@ export function CardReasonViewPage() {
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>{t('common.confirmDelete', 'Öçürmegi tassyklaň')}</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
{t('CardReasons.deleteConfirm', 'Bu kartyň çykarylmagynyň sebäbini öçürmek isleýärsiňizmi?')}
|
||||
{t('cardReasons.deleteConfirm', 'Bu kartyň çykarylmagynyň sebäbini öçürmek isleýärsiňizmi?')}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
|
||||
@@ -32,7 +32,7 @@ function useLoanTypeColumns(
|
||||
return [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
size: 60,
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold text-sm">{row.original.id}</span>
|
||||
|
||||
@@ -15,9 +15,11 @@ const DEFAULT_VISIBILITY: VisibilityState = {}
|
||||
const DEFAULT_ORDER = ['id', 'name', 'actions']
|
||||
|
||||
export default function RequiredDocumentsListPage() {
|
||||
const { t } = useTranslation()
|
||||
const { t, i18n } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
|
||||
// ── Table state ─────────────────────────────────────────────────────────────
|
||||
const [search, setSearch] = useState('')
|
||||
const [page, setPage] = useState(1)
|
||||
@@ -45,7 +47,7 @@ export default function RequiredDocumentsListPage() {
|
||||
{
|
||||
id: 'id',
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
size: 72,
|
||||
cell: ({ row }) => (
|
||||
<span
|
||||
@@ -59,9 +61,9 @@ export default function RequiredDocumentsListPage() {
|
||||
{
|
||||
id: 'name',
|
||||
header: t('loanDocuments.columns.name', 'ADY'),
|
||||
accessorFn: (row) => row.name.tk,
|
||||
accessorFn: (row) => row.name[lang],
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm text-foreground">{row.original.name.tk}</span>
|
||||
<span className="text-sm text-foreground">{row.original.name[lang]}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -11,9 +11,10 @@ import { ConfirmDialog } from '@/components/confirmDialog'
|
||||
export default function RequiredDocumentsViewPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation()
|
||||
const { t, i18n } = useTranslation()
|
||||
const [deleteOpen, setDeleteOpen] = useState(false)
|
||||
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
const docId = Number(id)
|
||||
const { data, isLoading } = useGetRequiredDocumentById(docId)
|
||||
const deleteMutation = useDeleteRequiredDocument()
|
||||
@@ -46,7 +47,7 @@ export default function RequiredDocumentsViewPage() {
|
||||
{/* Page heading */}
|
||||
<div className="flex items-start justify-between mb-4 gap-4">
|
||||
<h1 className="text-xl font-semibold text-foreground leading-snug line-clamp-2">
|
||||
{t('loanDocuments.viewTitle', 'Karz gerekli resminamalary giňişleýin')}: {data.name.tk}
|
||||
{t('loanDocuments.viewTitle', 'Karz gerekli resminamalary giňişleýin')}: {data.name[lang]}
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
<Button
|
||||
|
||||
@@ -47,7 +47,7 @@ export function BranchesListPage() {
|
||||
|
||||
const districtOptions = getDistrictOptions().map((d) => ({
|
||||
value: String(d.id),
|
||||
label: d.name.tk,
|
||||
label: d.name[lang],
|
||||
}))
|
||||
|
||||
const filterFields: FilterField[] = [
|
||||
@@ -84,7 +84,7 @@ export function BranchesListPage() {
|
||||
const columns: ColumnDef<Branch>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-mono text-sm font-medium">{row.original.id}</span>
|
||||
),
|
||||
|
||||
@@ -14,16 +14,15 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { Section, InfoRow } from '@/components/viewPageComponents'
|
||||
import { Section, InfoRow, MultiLangRow } from '@/components/viewPageComponents'
|
||||
import { useBranchById, useDeleteBranch } from '@/features/branches/hooks/useBranches'
|
||||
|
||||
export function BranchViewPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const navigate = useNavigate()
|
||||
const { t, i18n } = useTranslation()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const numericId = Number(id)
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
|
||||
const { data, isLoading } = useBranchById(numericId)
|
||||
const deleteMutation = useDeleteBranch()
|
||||
@@ -37,7 +36,7 @@ export function BranchViewPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{isLoading
|
||||
? '...'
|
||||
: `${t('branches.view.title', 'Şahamça giňişleýin')}: ${data?.name[lang] ?? ''}`}
|
||||
: `${t('branches.viewTitle', 'Şahamça giňişleýin')}: ${data?.name.tk ?? ''}`}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -77,33 +76,12 @@ export function BranchViewPage() {
|
||||
) : data ? (
|
||||
<>
|
||||
<Section title={t('branches.sections.basic', 'Esasy maglumatlar')}>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
<InfoRow label={t('branches.fields.code', 'Kod')} value={data.code} />
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-1">
|
||||
{t('branches.fields.name', 'Ady')}
|
||||
</span>
|
||||
<div>
|
||||
<div className="flex gap-3 mb-2 justify-end">
|
||||
{(['tk', 'ru', 'en'] as const).map((l) => (
|
||||
<span
|
||||
key={l}
|
||||
className={`text-sm cursor-default ${
|
||||
l === lang
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{l === 'tk' ? 'Türkmen' : l === 'ru' ? 'Русский' : 'English'}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-sm text-foreground">{data.name[lang]}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MultiLangRow label={t('branches.fields.name', 'Ady')} value={data.name} />
|
||||
|
||||
<InfoRow label={t('branches.fields.district', 'Etrap')} value={data.districtName[lang]} />
|
||||
<MultiLangRow label={t('branches.fields.district', 'Etrap')} value={data.districtName} />
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-2.5 px-4">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
@@ -118,28 +96,7 @@ export function BranchViewPage() {
|
||||
</Section>
|
||||
|
||||
<Section title={t('branches.sections.address', 'Salgy we habarlaşmak')}>
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-1">
|
||||
{t('branches.fields.address', 'Salgy')}
|
||||
</span>
|
||||
<div>
|
||||
<div className="flex gap-3 mb-2 justify-end">
|
||||
{(['tk', 'ru', 'en'] as const).map((l) => (
|
||||
<span
|
||||
key={l}
|
||||
className={`text-sm cursor-default ${
|
||||
l === lang
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{l === 'tk' ? 'Türkmen' : l === 'ru' ? 'Русский' : 'English'}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-sm text-foreground">{data.address[lang]}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MultiLangRow label={t('branches.fields.address', 'Salgy')} value={data.address} />
|
||||
<InfoRow label={t('branches.fields.phone', 'Telefon')} value={data.phone} />
|
||||
<InfoRow label={t('branches.fields.email', 'E-poçta')} value={data.email} />
|
||||
</Section>
|
||||
|
||||
@@ -68,7 +68,7 @@ export function DistrictsListPage() {
|
||||
const columns: ColumnDef<District>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-mono text-sm font-medium">{row.original.id}</span>
|
||||
),
|
||||
|
||||
@@ -14,16 +14,15 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { Section, InfoRow } from '@/components/viewPageComponents'
|
||||
import { Section, InfoRow, MultiLangRow } from '@/components/viewPageComponents'
|
||||
import { useDistrictById, useDeleteDistrict } from '@/features/districts/hooks/useDistricts'
|
||||
|
||||
export function DistrictViewPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const navigate = useNavigate()
|
||||
const { t, i18n } = useTranslation()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const numericId = Number(id)
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
|
||||
const { data, isLoading } = useDistrictById(numericId)
|
||||
const deleteMutation = useDeleteDistrict()
|
||||
@@ -37,7 +36,7 @@ export function DistrictViewPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{isLoading
|
||||
? '...'
|
||||
: `${t('districts.view.title', 'Etrap giňişleýin')}: ${data?.name[lang] ?? ''}`}
|
||||
: `${t('districts.viewTitle', 'Etrap giňişleýin')}: ${data?.name.tk ?? ''}`}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -76,30 +75,9 @@ export function DistrictViewPage() {
|
||||
</div>
|
||||
) : data ? (
|
||||
<Section>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-1">
|
||||
{t('districts.fields.name', 'Ady')}
|
||||
</span>
|
||||
<div>
|
||||
<div className="flex gap-3 mb-2 justify-end">
|
||||
{(['tk', 'ru', 'en'] as const).map((l) => (
|
||||
<span
|
||||
key={l}
|
||||
className={`text-sm cursor-default ${
|
||||
l === lang
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{l === 'tk' ? 'Türkmen' : l === 'ru' ? 'Русский' : 'English'}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-sm text-foreground">{data.name[lang]}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MultiLangRow label={t('districts.fields.name', 'Ady')} value={data.name} />
|
||||
|
||||
<InfoRow
|
||||
label={t('districts.fields.description', 'Bellikler')}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react'
|
||||
import { useState, useMemo } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Eye, Pencil, Trash2 } from 'lucide-react'
|
||||
@@ -19,21 +19,19 @@ import {
|
||||
import { usePermissions, useDeletePermission } from '@/features/permissions/hooks/usePermissions'
|
||||
import type { Permission } from '@/features/permissions/api/permissionsApi'
|
||||
|
||||
// ─── Column meta for toolbar ──────────────────────────────────────────────────
|
||||
|
||||
const COLUMN_META = [
|
||||
{ id: 'id', label: 'ID' },
|
||||
{ id: 'code', label: 'Kod' },
|
||||
{ id: 'name', label: 'Ady' },
|
||||
{ id: 'guard_name', label: 'Guard name' },
|
||||
]
|
||||
|
||||
// ─── PermissionsPage ──────────────────────────────────────────────────────────
|
||||
|
||||
export default function PermissionsPage() {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const columnMeta = useMemo(() => [
|
||||
{ id: 'id', label: t('common.id', 'ID') },
|
||||
{ id: 'code', label: t('permissions.fields.code', 'Kod') },
|
||||
{ id: 'name', label: t('permissions.fields.name', 'Ady') },
|
||||
{ id: 'guard_name', label: t('permissions.fields.guardName', 'Guard name') },
|
||||
], [t])
|
||||
|
||||
// ── State ──────────────────────────────────────────────────────────────────
|
||||
const [search, setSearch] = useState('')
|
||||
const [page, setPage] = useState(1)
|
||||
@@ -50,7 +48,7 @@ export default function PermissionsPage() {
|
||||
const columns: ColumnDef<Permission>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
size: 70,
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold">{row.original.id}</span>
|
||||
@@ -67,7 +65,7 @@ export default function PermissionsPage() {
|
||||
},
|
||||
{
|
||||
accessorKey: 'guard_name',
|
||||
header: 'Guard name',
|
||||
header: t('permissions.fields.guardName', 'Guard name'),
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
@@ -132,7 +130,7 @@ export default function PermissionsPage() {
|
||||
searchValue={search}
|
||||
onSearchChange={(v) => { setSearch(v); setPage(1) }}
|
||||
searchPlaceholder={t('permissions.searchPlaceholder', 'Gözlemek...')}
|
||||
columns={COLUMN_META}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react'
|
||||
import { useState, useMemo } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Eye, Pencil, Trash2 } from 'lucide-react'
|
||||
@@ -19,21 +19,19 @@ import {
|
||||
import { useRoles, useDeleteRole } from '@/features/roles/hooks/useRoles'
|
||||
import type { Role } from '@/features/roles/api/rolesApi'
|
||||
|
||||
// ─── Column meta for toolbar ──────────────────────────────────────────────────
|
||||
|
||||
const COLUMN_META = [
|
||||
{ id: 'id', label: 'ID' },
|
||||
{ id: 'code', label: 'Kod' },
|
||||
{ id: 'name', label: 'Ady' },
|
||||
{ id: 'guard_name', label: 'Guard name' },
|
||||
]
|
||||
|
||||
// ─── RolesPage ────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function RolesPage() {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const columnMeta = useMemo(() => [
|
||||
{ id: 'id', label: t('common.id', 'ID') },
|
||||
{ id: 'code', label: t('roles.fields.code', 'Kod') },
|
||||
{ id: 'name', label: t('roles.fields.name', 'Ady') },
|
||||
{ id: 'guard_name', label: t('roles.fields.guardName', 'Guard name') },
|
||||
], [t])
|
||||
|
||||
// ── State ──────────────────────────────────────────────────────────────────
|
||||
const [search, setSearch] = useState('')
|
||||
const [page, setPage] = useState(1)
|
||||
@@ -50,7 +48,7 @@ export default function RolesPage() {
|
||||
const columns: ColumnDef<Role>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
size: 70,
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold">{row.original.id}</span>
|
||||
@@ -67,7 +65,7 @@ export default function RolesPage() {
|
||||
},
|
||||
{
|
||||
accessorKey: 'guard_name',
|
||||
header: 'Guard name',
|
||||
header: t('roles.fields.guardName', 'Guard name'),
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
@@ -132,7 +130,7 @@ export default function RolesPage() {
|
||||
searchValue={search}
|
||||
onSearchChange={(v) => { setSearch(v); setPage(1) }}
|
||||
searchPlaceholder={t('roles.searchPlaceholder', 'Gözlemek...')}
|
||||
columns={COLUMN_META}
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
|
||||
@@ -74,7 +74,7 @@ export default function UsersListPage() {
|
||||
const columns: ColumnDef<UserListItem>[] = [
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: "ID",
|
||||
header: t("common.id", "ID"),
|
||||
size: 80,
|
||||
cell: ({ row }) => <span className="text-xs font-mono text-primary font-semibold">{row.original.id}</span>,
|
||||
},
|
||||
@@ -149,7 +149,7 @@ export default function UsersListPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="mb-6">
|
||||
<h1 className="text-2xl font-semibold text-foreground">{t("clients.title", "Ahli Müşderiler")}</h1>
|
||||
<h1 className="text-2xl font-semibold text-foreground">{t("users.title", "Ähli ulanyjylar")}</h1>
|
||||
</div>
|
||||
<div className="bg-card border border-border rounded-xl p-4">
|
||||
{/* Toolbar */}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Pencil, Trash2, CheckCircle2, XCircle, Inbox } from "lucide-react";
|
||||
import { Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
@@ -18,27 +18,11 @@ import {
|
||||
Section,
|
||||
InfoRow,
|
||||
CollapsibleSection,
|
||||
EmptyState,
|
||||
} from "@/components/viewPageComponents";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { useUser, useDeleteUser } from "@/features/allUsers/hooks/useAllUsers";
|
||||
|
||||
// ─── EmptyState ───────────────────────────────────────────────────────────────
|
||||
|
||||
interface EmptyStateProps {
|
||||
label: string;
|
||||
}
|
||||
|
||||
function EmptyState({ label }: EmptyStateProps) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center py-16 gap-3">
|
||||
<div className="w-16 h-16 rounded-full bg-muted flex items-center justify-center">
|
||||
<Inbox size={32} className="text-muted-foreground" />
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground">{label}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── UserViewPage ─────────────────────────────────────────────────────────────
|
||||
|
||||
export default function UserViewPage() {
|
||||
|
||||
@@ -37,7 +37,7 @@ export default function ClientsPage() {
|
||||
const columns: ColumnDef<Client>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span
|
||||
className="text-primary font-semibold cursor-pointer hover:underline text-sm"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useState } from 'react'
|
||||
import { useParams, useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Pencil, Trash2, XCircle, CheckCircle2, Inbox } from 'lucide-react'
|
||||
import { Pencil, Trash2, XCircle, CheckCircle2 } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { ConfirmDialog } from '@/components/confirmDialog'
|
||||
import { BentoGrid, BentoCard, InfoRow, AuditLog, CollapsibleSection } from '@/components/viewPageComponents'
|
||||
import { BentoGrid, BentoCard, InfoRow, AuditLog, CollapsibleSection, EmptyState } from '@/components/viewPageComponents'
|
||||
import { DataTable, type ColumnDef } from '@/components/dataTable'
|
||||
import { DataTableToolbar } from '@/components/dataTableToolbar'
|
||||
import { useClient, useDeleteClient } from '@/features/clients/hooks/useClients'
|
||||
@@ -21,23 +21,6 @@ function ActiveIndicator({ active }: { active: boolean }) {
|
||||
);
|
||||
}
|
||||
|
||||
// ─── EmptyState ───────────────────────────────────────────────────────────────
|
||||
|
||||
interface EmptyStateProps {
|
||||
label: string;
|
||||
}
|
||||
|
||||
function EmptyState({ label }: EmptyStateProps) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center py-12 gap-4">
|
||||
<div className="w-16 h-16 rounded-full bg-muted flex items-center justify-center">
|
||||
<Inbox size={32} className="text-muted-foreground" />
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground text-center">{label}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function ClientDetailPage() {
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function OperatorsPage() {
|
||||
const columns: ColumnDef<Operator>[] = [
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: "ID",
|
||||
header: t("common.id", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<span
|
||||
className="text-primary font-semibold cursor-pointer hover:underline text-sm"
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
Trash2,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
Inbox,
|
||||
Eye,
|
||||
} from "lucide-react";
|
||||
import { useState } from "react";
|
||||
@@ -18,6 +17,7 @@ import {
|
||||
InfoRow,
|
||||
AuditLog,
|
||||
CollapsibleSection,
|
||||
EmptyState,
|
||||
} from "@/components/viewPageComponents";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
@@ -42,23 +42,6 @@ function ActiveIndicator({ active }: { active: boolean }) {
|
||||
);
|
||||
}
|
||||
|
||||
// ─── EmptyState ───────────────────────────────────────────────────────────────
|
||||
|
||||
interface EmptyStateProps {
|
||||
label: string;
|
||||
}
|
||||
|
||||
function EmptyState({ label }: EmptyStateProps) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center py-12 gap-4">
|
||||
<div className="w-16 h-16 rounded-full bg-muted flex items-center justify-center">
|
||||
<Inbox size={32} className="text-muted-foreground" />
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground text-center">{label}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function OperatorDetailPage() {
|
||||
@@ -228,7 +211,7 @@ export default function OperatorDetailPage() {
|
||||
accessorKey: "billingUsernameIbr",
|
||||
header: t("branches.fields.billingIbr", "BILLING ULANYJY ADY"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm font-mono text-xs">
|
||||
<span className="text-sm font-mono">
|
||||
{row.original.billingUsernameIbr}
|
||||
</span>
|
||||
),
|
||||
@@ -237,7 +220,7 @@ export default function OperatorDetailPage() {
|
||||
accessorKey: "billingUsernameSber",
|
||||
header: t("branches.fields.billingSber", "BILLING USERNAME (SBER)"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm font-mono text-xs">
|
||||
<span className="text-sm font-mono ">
|
||||
{row.original.billingUsernameSber}
|
||||
</span>
|
||||
),
|
||||
@@ -246,7 +229,7 @@ export default function OperatorDetailPage() {
|
||||
accessorKey: "billingUsernameVisa",
|
||||
header: t("branches.fields.billingVisa", "BILLING USERNAME (VISA)"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm font-mono text-xs">
|
||||
<span className="text-sm font-mono ">
|
||||
{row.original.billingUsernameVisa}
|
||||
</span>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user