added missin lang keys
This commit is contained 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