refactored some code
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Download, Trash2, Database, CheckCircle2, XCircle, Clock } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Download, Database, CheckCircle2, XCircle, Clock } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ColumnMeta } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
@@ -79,27 +79,17 @@ export default function BackupsPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => downloadBackup.mutate(row.original.id)}
|
||||
disabled={row.original.status === "in_progress"}
|
||||
title={t("common.download", "Ýükle")}
|
||||
>
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
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("common.delete", "Poz")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
extraActions={[
|
||||
{
|
||||
icon: Download,
|
||||
title: t("common.download", "Ýükle"),
|
||||
onClick: () => downloadBackup.mutate(row.original.id),
|
||||
disabled: row.original.status === "in_progress",
|
||||
},
|
||||
]}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -128,7 +118,7 @@ export default function BackupsPage() {
|
||||
{t("backups.title", "Bekaplar")}
|
||||
</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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 { Download } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ColumnMeta } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { VisibilityState } from "@tanstack/react-table";
|
||||
import { useCardBalances, useDeleteCardBalance, useDownloadCardBalance } from "@/features/cardBalance/hooks/useCardBalance";
|
||||
import { type CardBalance } from "@/features/cardBalance/api/cardBalanceApi";
|
||||
@@ -77,44 +77,13 @@ export default function CardBalancesPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => downloadMutation.mutate(row.original.id)}
|
||||
title={t("Download", "Ýükle")}
|
||||
>
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => navigate(`/card-balances/${row.original.id}`)}
|
||||
title={t("View", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => navigate(`/card-balances/${row.original.id}/edit`)}
|
||||
title={t("Edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
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")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
extraActions={[{ icon: Download, title: t("Download", "Ýükle"), onClick: () => downloadMutation.mutate(row.original.id) }]}
|
||||
onView={() => navigate(`/card-balances/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/card-balances/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -140,7 +109,7 @@ export default function CardBalancesPage() {
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("Card balances", "Kart galyndylary")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -6,12 +6,12 @@ import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { useCardPins } from "@/features/cardPins/hooks/useCardPins";
|
||||
import { useDeleteCardPin } from "@/features/cardPins/hooks/useCardPins";
|
||||
import type { CardPinItem, CardPinStatus } from "@/features/cardPins/api/cardPinApi";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { Eye, Pencil, Trash2, AlertCircle, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { AlertCircle, CheckCircle2, XCircle } from "lucide-react";
|
||||
|
||||
import { useCardPins, useDeleteCardPin } from "@/features/cardPins/hooks/useCardPins";
|
||||
import { type CardPinStatus, type CardPinItem } from "@/features/cardPins/api/cardPinApi";
|
||||
|
||||
// ─── Status Badge ─────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -114,22 +114,12 @@ export default function CardPinsPage() {
|
||||
id: "actions",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1">
|
||||
<Button size="icon" variant="ghost" className="h-7 w-7" onClick={() => navigate(`/card-pins/${row.original.id}`)}>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button size="icon" variant="ghost" className="h-7 w-7" onClick={() => navigate(`/card-pins/${row.original.id}/edit`)}>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => setDeleteTarget(row.original)}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/card-pins/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/card-pins/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteTarget(row.original)}
|
||||
isDeleting={isDeleting}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -147,7 +137,7 @@ export default function CardPinsPage() {
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("Card pins", "Kart pin bukjalary")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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 { Download } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ColumnMeta } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { VisibilityState } from "@tanstack/react-table";
|
||||
import { useCardRequisites, useDeleteCardRequisite, useDownloadCardRequisite } from "@/features/cardRequisites/hooks/useCardRequisites";
|
||||
import type { CardRequisite, CardRequisiteStatus } from "@/features/cardRequisites/api/cardRequisitesApi";
|
||||
@@ -122,25 +122,13 @@ export default function CardRequisitesPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button variant="ghost" size="icon" className="h-7 w-7" onClick={() => downloadMutation.mutate(row.original.id)}>
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
<Button variant="ghost" size="icon" className="h-7 w-7" onClick={() => navigate(`/card-requisites/${row.original.id}`)}>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button variant="ghost" size="icon" className="h-7 w-7" onClick={() => navigate(`/card-requisites/${row.original.id}/edit`)}>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
extraActions={[{ icon: Download, title: t("Download", "Ýükle"), onClick: () => downloadMutation.mutate(row.original.id) }]}
|
||||
onView={() => navigate(`/card-requisites/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/card-requisites/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -171,7 +159,7 @@ export default function CardRequisitesPage() {
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("Card requisites", "Kart rekwizitler")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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 { Download } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ColumnMeta } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { VisibilityState } from "@tanstack/react-table";
|
||||
import {
|
||||
useCardTransactions,
|
||||
@@ -86,44 +86,13 @@ export default function CardTransactionsPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => downloadMutation.mutate(row.original.id)}
|
||||
title={t("Download", "Ýükle")}
|
||||
>
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => navigate(`/card-transactions/${row.original.id}`)}
|
||||
title={t("View", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => navigate(`/card-transactions/${row.original.id}/edit`)}
|
||||
title={t("Edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
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")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
extraActions={[{ icon: Download, title: t("Download", "Ýükle"), onClick: () => downloadMutation.mutate(row.original.id) }]}
|
||||
onView={() => navigate(`/card-transactions/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/card-transactions/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -155,7 +124,7 @@ export default function CardTransactionsPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("Card transactions", "Kart hereketleri")}</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useState, useMemo, useCallback } from "react";
|
||||
import { useNavigate, Link } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle, AlertCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle, AlertCircle } from "lucide-react";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useCardOrders, useDeleteCardOrder, useProvinces, useBranches } from "@/features/orderNewCard/hooks/useOrderNewCard";
|
||||
import type { CardOrderListItem, CardOrderStatus } from "@/features/orderNewCard/api/orderNewCardApi";
|
||||
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
|
||||
@@ -183,30 +184,12 @@ export default function CardOrdersPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1.5 justify-end">
|
||||
<button
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "Görkez")}
|
||||
onClick={() => navigate(`/order-new-card/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Düzet")}
|
||||
onClick={() => navigate(`/order-new-card/${row.original.id}/edit`)}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50"
|
||||
title={t("common.delete", "Poz")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/order-new-card/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/order-new-card/${row.original.id}/edit`)}
|
||||
onDelete={() => handleDelete(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 100,
|
||||
},
|
||||
@@ -247,7 +230,7 @@ export default function CardOrdersPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground tracking-tight">{t("cardOrder.title", "Kart sargytlary")}</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2 } from "lucide-react";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useGetCurrencyRates, useDeleteCurrencyRate } from "@/features/currencyRates/hooks/useCurrencyRates";
|
||||
import type { CurrencyRate } from "@/features/currencyRates/api/currencyRatesApi";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
@@ -87,35 +86,12 @@ export default function CurrencyRatesPage() {
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/currency-rates/${row.original.id}`)}
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/currency-rates/${row.original.id}/edit`)}
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t("common.delete", "Pozmak")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/currency-rates/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/currency-rates/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 120,
|
||||
},
|
||||
@@ -133,7 +109,7 @@ export default function CurrencyRatesPage() {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<h1 className="text-2xl font-semibold text-foreground mb-5">{t("currencyRates.title", "Walýuta kursy")}</h1>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput value={search} onChange={handleSearchChange} placeholder={t("common.search", "Gözlemek")} />
|
||||
<CreateButton
|
||||
label={t("currencyRates.actions.create", "Walýuta kursy dörediň")}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Pencil, Trash2 } from "lucide-react";
|
||||
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
@@ -75,26 +75,10 @@ export default function VisaMasterSettingsPage() {
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/visa-master-sber-settings/${row.original.id}/edit`)}
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t("common.delete", "Pozmak")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onEdit={() => navigate(`/visa-master-sber-settings/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
/>
|
||||
),
|
||||
size: 100,
|
||||
},
|
||||
@@ -112,7 +96,7 @@ export default function VisaMasterSettingsPage() {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<h1 className="text-2xl font-semibold text-foreground mb-5">{t("visaMasterSettings.title", "Visa/Master, Sber sazlamalar")}</h1>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput value={search} onChange={handleSearchChange} placeholder={t("common.search", "Gözlemek")} />
|
||||
<CreateButton
|
||||
label={t("visaMasterSettings.actions.create", "Visa/Master, Sber sazlamalar dörediň")}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useMemo, useCallback } from "react";
|
||||
import { format } from "date-fns";
|
||||
import { Eye, Edit, ArrowUpDown, Trash2 } from "lucide-react";
|
||||
import { Edit, ArrowUpDown } from "lucide-react";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -8,6 +8,7 @@ import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ColumnMeta, type FilterField, type ActiveFilter } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { MonthSelect } from "@/components/monthSelect";
|
||||
import { useSberPaymentOrders, useDeleteSberPayment } from "@/features/sberPayments/hooks/useSberPayments";
|
||||
import {
|
||||
@@ -213,29 +214,13 @@ export default function SberPaymentsListPage() {
|
||||
const order = row.original;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-1">
|
||||
<button
|
||||
onClick={() => navigate(`/sber-payments/${order.id}`)}
|
||||
className="p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "View")}
|
||||
>
|
||||
<Eye size={16} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate(`/sber-payments/${order.id}/edit`)}
|
||||
className="p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Edit")}
|
||||
>
|
||||
<Edit size={16} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setDeleteTarget(order)}
|
||||
className="p-1.5 rounded hover:bg-accent text-destructive hover:bg-destructive/10 transition-colors"
|
||||
title={t("common.delete", "Delete")}
|
||||
>
|
||||
<Trash2 size={16} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/sber-payments/${order.id}`)}
|
||||
onEdit={() => navigate(`/sber-payments/${order.id}/edit`)}
|
||||
onDelete={() => setDeleteTarget(order)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
editIcon={Edit}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -292,7 +277,7 @@ export default function SberPaymentsListPage() {
|
||||
<div className="space-y-4">
|
||||
{/* Page Title */}
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("sberPayments.list.title", "Sber tölegler (talyplar üçin)")}</h1>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(val) => {
|
||||
|
||||
@@ -6,14 +6,13 @@ import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { useIntlPayments, useDeleteIntlPayment } from "@/features/visaMasterPayments/hooks/useVisaMasterPayments";
|
||||
import type { IntlPaymentItem, IntlPaymentStatus } from "@/features/visaMasterPayments/api/visaMasterPaymentsApi";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Eye, Pencil, Trash2 } from "lucide-react";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { MonthSelect } from "@/components/monthSelect";
|
||||
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
|
||||
import { AlertCircle, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { useIntlPayments, useDeleteIntlPayment } from "@/features/visaMasterPayments/hooks/useVisaMasterPayments";
|
||||
import type { IntlPaymentStatus, IntlPaymentItem } from "@/features/visaMasterPayments/api/visaMasterPaymentsApi";
|
||||
// ─── Status badge (defined inside component for t() access) ───────────────────
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
@@ -94,22 +93,12 @@ export default function IntlPaymentsPage() {
|
||||
id: "actions",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1">
|
||||
<Button size="icon" variant="ghost" className="h-7 w-7" onClick={() => navigate(`/visa-master/${row.original.id}`)}>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button size="icon" variant="ghost" className="h-7 w-7" onClick={() => navigate(`/visa-master/${row.original.id}/edit`)}>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => setDeleteTarget(row.original)}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/visa-master/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/visa-master/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteTarget(row.original)}
|
||||
isDeleting={isDeleting}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -127,7 +116,7 @@ export default function IntlPaymentsPage() {
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("intlPayment.title", "Halkara tölegler (Visa/Mastercard)")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useMemo, useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2, AlertCircle, CheckCircle2, XCircle, Loader2 } from "lucide-react";
|
||||
import { AlertCircle, CheckCircle2, XCircle, Loader2 } from "lucide-react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
|
||||
@@ -8,6 +8,7 @@ import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useLoanOrderMobiles, useDeleteLoanOrderMobile } from "@/features/loanOrderMobiles/hooks/useLoanOrderMobiles";
|
||||
import type { LoanOrderMobile, LoanOrderMobileStatus } from "@/features/loanOrderMobiles/api/loanOrderMobilesApi";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
@@ -166,30 +167,12 @@ export default function LoanOrderMobilesPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1.5 justify-end">
|
||||
<button
|
||||
onClick={() => navigate(`/loan-order-mobiles/${row.original.id}`)}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate(`/loan-order-mobiles/${row.original.id}/edit`)}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50"
|
||||
title={t("common.delete", "Pozmak")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/loan-order-mobiles/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/loan-order-mobiles/${row.original.id}/edit`)}
|
||||
onDelete={() => handleDelete(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 100,
|
||||
},
|
||||
@@ -237,7 +220,7 @@ export default function LoanOrderMobilesPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("loanOrderMobiles.title", "Karz sargytlary")}</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useState, useMemo, useCallback } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2, AlertCircle, CheckCircle2, XCircle, Loader2 } from "lucide-react";
|
||||
import { AlertCircle, CheckCircle2, XCircle, Loader2 } from "lucide-react";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
|
||||
import { useLoanOrders, useDeleteLoanOrder } from "@/features/loanOrders/hooks/useLoanOrders";
|
||||
import type { LoanOrder, LoanOrderStatus } from "@/features/loanOrders/api/loanOrdersApi";
|
||||
@@ -175,30 +176,12 @@ export default function LoanOrdersPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1.5 justify-end">
|
||||
<button
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "View")}
|
||||
onClick={() => navigate(`/loan-orders/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Edit")}
|
||||
onClick={() => navigate(`/loan-orders/${row.original.id}/edit`)}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50"
|
||||
title={t("common.delete", "Delete")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/loan-orders/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/loan-orders/${row.original.id}/edit`)}
|
||||
onDelete={() => handleDelete(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 100,
|
||||
},
|
||||
@@ -243,7 +226,7 @@ export default function LoanOrdersPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("loanOrders.title", "Karz sargytlary")}</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useState, useMemo, useCallback } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2, TableProperties } from "lucide-react";
|
||||
import { TableProperties } from "lucide-react";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useLoanPaidOffLetters, useDeleteLoanPaidOffLetter } from "@/features/loanPaidOffLetters/hooks/useLoanPaidOffLetters";
|
||||
import type { LoanPaidOffLetter } from "@/features/loanPaidOffLetters/api/loanPaidOffLettersApi";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
@@ -130,30 +131,12 @@ export default function LoanPaidOffLettersPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1.5 justify-end">
|
||||
<button
|
||||
onClick={() => navigate(`/loan-paid-off-letters/${row.original.id}`)}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate(`/loan-paid-off-letters/${row.original.id}/edit`)}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50"
|
||||
title={t("common.delete", "Pozmak")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/loan-paid-off-letters/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/loan-paid-off-letters/${row.original.id}/edit`)}
|
||||
onDelete={() => handleDelete(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 100,
|
||||
},
|
||||
@@ -181,7 +164,7 @@ export default function LoanPaidOffLettersPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("loanPaidOffLetters.title", "Karzyň ýapylandygy barada güwanamalar")} </h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useState, useMemo, useCallback } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2 } from "lucide-react";
|
||||
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useLoanRemaining, useDeleteLoanRemaining } from "@/features/loanRemaining/hooks/useLoanRemaining";
|
||||
import type { LoanRemaining } from "@/features/loanRemaining/api/loanRemainingApi";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
@@ -94,30 +95,12 @@ export default function LoanRemainingPage() {
|
||||
header: "",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1.5 justify-end">
|
||||
<button
|
||||
onClick={() => navigate(`/loan-remaining/${row.original.id}`)}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate(`/loan-remaining/${row.original.id}/edit`)}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-1.5 cursor-pointer rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50"
|
||||
title={t("common.delete", "Pozmak")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/loan-remaining/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/loan-remaining/${row.original.id}/edit`)}
|
||||
onDelete={() => handleDelete(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 100,
|
||||
},
|
||||
@@ -138,7 +121,7 @@ export default function LoanRemainingPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground">{t("loanRemaining.title", "Karzyň galyndysy")}</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { FilterField, ActiveFilter } from "@/components/dataTableToolbar";
|
||||
import { useCardTypes, useDeleteCardType } from "@/features/cardTypes/hooks/useCardTypes";
|
||||
import type { CardType } from "@/features/cardTypes/api/cardTypesApi";
|
||||
@@ -92,29 +93,11 @@ export function CardTypesListPage() {
|
||||
id: "actions",
|
||||
header: "",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-2 justify-end">
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/card/card-types/${row.original.id}`)}
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/card/card-types/${row.original.id}/edit`)}
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t("common.delete", "Öçürmek")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/card/card-types/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/card/card-types/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
/>
|
||||
),
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
@@ -139,7 +122,7 @@ export function CardTypesListPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">{t("cardTypes.title", "Kart görnüşleri")}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { FilterField, ActiveFilter } from "@/components/dataTableToolbar";
|
||||
import { useCardReasons, useDeleteCardReason } from "@/features/cardReasons/hooks/useCardReasons";
|
||||
import type { CardReason } from "@/features/cardReasons/api/cardReasonsApi";
|
||||
@@ -103,29 +104,11 @@ export function CardReasonsListPage() {
|
||||
id: "actions",
|
||||
header: "",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-2 justify-end">
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/card/card-reasons/${row.original.id}`)}
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/card/card-reasons/${row.original.id}/edit`)}
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t("common.delete", "Öçürmek")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/card/card-reasons/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/card/card-reasons/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
/>
|
||||
),
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
@@ -150,7 +133,7 @@ export function CardReasonsListPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">{t("cardReasons.title", "Kartyň çykarylmagynyň sebäpleri")}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useGetLoanTypes, useDeleteLoanType } from "@/features/loanTypes/hooks/useLoanTypes";
|
||||
import type { LoanType } from "@/features/loanTypes/api/loanTypesApi";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
@@ -71,29 +72,11 @@ function useLoanTypeColumns(
|
||||
size: 120,
|
||||
enableSorting: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1">
|
||||
<button
|
||||
onClick={() => onView(row.original.id)}
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => onEdit(row.original.id)}
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Redaktirlemek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => onDelete(row.original.id)}
|
||||
className="p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors"
|
||||
title={t("common.delete", "Pozmak")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => onView(row.original.id)}
|
||||
onEdit={() => onEdit(row.original.id)}
|
||||
onDelete={() => onDelete(row.original.id)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -138,7 +121,7 @@ export default function LoanTypesListPage() {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<h1 className="text-xl font-semibold text-foreground mb-5">{t("loanTypes.title", "Karz görnüşleri")}</h1>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2 } from "lucide-react";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useGetRequiredDocuments, useDeleteRequiredDocument } from "@/features/requiredDocuments/hooks/useRequiredDocuments";
|
||||
import type { LoanDocument } from "@/features/requiredDocuments/api/requiredDocumentsApi";
|
||||
import type { VisibilityState } from "@tanstack/react-table";
|
||||
@@ -72,30 +72,12 @@ export default function RequiredDocumentsListPage() {
|
||||
size: 100,
|
||||
enableSorting: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
<button
|
||||
onClick={() => navigate(`/settings/loan/required-documents/${row.original.id}`)}
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.view", "Görüntüle")}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate(`/settings/loan/required-documents/${row.original.id}/edit`)}
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t("common.edit", "Düzet")}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors"
|
||||
title={t("common.delete", "Öçür")}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/loan/required-documents/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/loan/required-documents/${row.original.id}/edit`)}
|
||||
onDelete={() => handleDelete(row.original.id)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -108,7 +90,7 @@ export default function RequiredDocumentsListPage() {
|
||||
<div className="space-y-4">
|
||||
{/* Page heading */}
|
||||
<h1 className="text-xl font-semibold text-foreground mb-4">{t("loanDocuments.title", "Karz gerekli resminamalary")}</h1>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { FilterField, ActiveFilter } from "@/components/dataTableToolbar";
|
||||
import { useBranches, useDeleteBranch } from "@/features/branches/hooks/useBranches";
|
||||
import type { Branch } from "@/features/branches/api/branchesApi";
|
||||
@@ -118,29 +119,11 @@ export function BranchesListPage() {
|
||||
id: "actions",
|
||||
header: "",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-2 justify-end">
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/location/branches/${row.original.id}`)}
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/location/branches/${row.original.id}/edit`)}
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t("common.delete", "Öçürmek")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/location/branches/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/location/branches/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
/>
|
||||
),
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
@@ -164,7 +147,7 @@ export function BranchesListPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">{t("branches.title", "Şahamçalar")}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { FilterField, ActiveFilter } from "@/components/dataTableToolbar";
|
||||
import { useDistricts, useDeleteDistrict } from "@/features/districts/hooks/useDistricts";
|
||||
import type { District } from "@/features/districts/api/districtsApi";
|
||||
@@ -86,29 +87,11 @@ export function DistrictsListPage() {
|
||||
id: "actions",
|
||||
header: "",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-2 justify-end">
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/location/districts/${row.original.id}`)}
|
||||
title={t("common.view", "Görmek")}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() => navigate(`/settings/location/districts/${row.original.id}/edit`)}
|
||||
title={t("common.edit", "Üýtgetmek")}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</button>
|
||||
<button
|
||||
className="p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
title={t("common.delete", "Öçürmek")}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/location/districts/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/location/districts/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
/>
|
||||
),
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
@@ -132,7 +115,7 @@ export function DistrictsListPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">{t("districts.title", "Etraplar")}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { useState, useMemo } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2 } from "lucide-react";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { usePermissions, useDeletePermission } from "@/features/permissions/hooks/usePermissions";
|
||||
import type { Permission } from "@/features/permissions/api/permissionsApi";
|
||||
@@ -68,32 +67,12 @@ export default function PermissionsPage() {
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-primary"
|
||||
onClick={() => navigate(`/settings/users/permissions/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-blue-500"
|
||||
onClick={() => navigate(`/settings/users/permissions/${row.original.id}/edit`)}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/users/permissions/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/users/permissions/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
isDeleting={deletePermission.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -114,7 +93,7 @@ export default function PermissionsPage() {
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h1 className="text-2xl font-bold text-foreground">{t("permissions.title", "Rugsatlar")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { useState, useMemo } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2 } from "lucide-react";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { useRoles, useDeleteRole } from "@/features/roles/hooks/useRoles";
|
||||
import type { Role } from "@/features/roles/api/rolesApi";
|
||||
@@ -68,32 +67,12 @@ export default function RolesPage() {
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-primary"
|
||||
onClick={() => navigate(`/settings/users/roles/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-blue-500"
|
||||
onClick={() => navigate(`/settings/users/roles/${row.original.id}/edit`)}
|
||||
>
|
||||
<Pencil size={15} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => setDeleteId(row.original.id)}
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/settings/users/roles/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/settings/users/roles/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteId(row.original.id)}
|
||||
isDeleting={deleteRole.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -114,7 +93,7 @@ export default function RolesPage() {
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h1 className="text-2xl font-bold text-foreground">{t("roles.title", "Rollar")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Eye, Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar, type ActiveFilter } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import type { VisibilityState } from "@tanstack/react-table";
|
||||
|
||||
import { useUsers, useDeleteUser } from "@/features/allUsers/hooks/useAllUsers";
|
||||
@@ -120,22 +120,12 @@ export default function UsersListPage() {
|
||||
size: 100,
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1">
|
||||
<Button variant="ghost" size="icon" className="h-7 w-7" onClick={() => navigate(`/all-users/${row.original.id}`)}>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button variant="ghost" size="icon" className="h-7 w-7" onClick={() => navigate(`/all-users/${row.original.id}/edit`)}>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => setDeleteTarget(row.original)}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/all-users/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/all-users/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteTarget(row.original)}
|
||||
isDeleting={deleteUser.isPending}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -153,7 +143,7 @@ export default function UsersListPage() {
|
||||
<div className="mb-6">
|
||||
<h1 className="text-2xl font-semibold text-foreground">{t("users.title", "Ähli ulanyjylar")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput value={search} onChange={handleSearchChange} placeholder={t("users.searchPlaceholder", "Gözlemek")} />
|
||||
<CreateButton label={t("users.actions.create", "Ulanyjy dörediň")} onClick={() => navigate("/all-users/create")} />
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Trash2, Eye, Pencil, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useClients, useDeleteClient } from "@/features/clients/hooks/useClients";
|
||||
import type { Client } from "@/features/clients/api/clientsApi";
|
||||
|
||||
@@ -85,32 +85,12 @@ export default function ClientsPage() {
|
||||
id: "actions",
|
||||
header: "",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/clients/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/clients/${row.original.id}/edit`)}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => setDeleteTarget(row.original)}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/clients/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/clients/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteTarget(row.original)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 120,
|
||||
enableSorting: false,
|
||||
@@ -129,7 +109,7 @@ export default function ClientsPage() {
|
||||
<div className="mb-6">
|
||||
<h1 className="text-2xl font-semibold text-foreground">{t("clients.title", "Müşderiler")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Trash2, Eye, Pencil, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DataTable, type ColumnDef } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { useOperators, useDeleteOperator } from "@/features/operators/hooks/useOperators";
|
||||
import type { Operator } from "@/features/operators/api/operatorsApi";
|
||||
|
||||
@@ -91,32 +91,12 @@ export default function OperatorsPage() {
|
||||
id: "actions",
|
||||
header: "",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/operators/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/operators/${row.original.id}/edit`)}
|
||||
>
|
||||
<Pencil size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-destructive"
|
||||
onClick={() => setDeleteTarget(row.original)}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
<TableActions
|
||||
onView={() => navigate(`/operators/${row.original.id}`)}
|
||||
onEdit={() => navigate(`/operators/${row.original.id}/edit`)}
|
||||
onDelete={() => setDeleteTarget(row.original)}
|
||||
isDeleting={deleteMutation.isPending}
|
||||
/>
|
||||
),
|
||||
size: 120,
|
||||
enableSorting: false,
|
||||
@@ -137,7 +117,7 @@ export default function OperatorsPage() {
|
||||
<div className="mb-6">
|
||||
<h1 className="text-2xl font-semibold text-foreground">{t("operators.title", "Operatorlar")}</h1>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-3 justify-between">
|
||||
<div className="flex items-center gap-3 justify-between">
|
||||
<TableSearchInput
|
||||
value={search}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -1,45 +1,21 @@
|
||||
import { useParams, useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Pencil,
|
||||
Trash2,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
Eye,
|
||||
} from "lucide-react";
|
||||
import { TableActions } from "@/components/tableActions";
|
||||
import { Pencil, Trash2, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { ConfirmDialog } from "@/components/confirmDialog";
|
||||
import {
|
||||
BentoGrid,
|
||||
BentoCard,
|
||||
InfoRow,
|
||||
AuditLog,
|
||||
CollapsibleSection,
|
||||
EmptyState,
|
||||
} 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 {
|
||||
useOperator,
|
||||
useDeleteOperator,
|
||||
} from "@/features/operators/hooks/useOperators";
|
||||
import type {
|
||||
OperatorRole,
|
||||
OperatorBranch,
|
||||
OperatorAuditLog,
|
||||
OperatorPermission,
|
||||
} from "@/features/operators/api/operatorsApi";
|
||||
import { useOperator, useDeleteOperator } from "@/features/operators/hooks/useOperators";
|
||||
import type { OperatorRole, OperatorBranch, OperatorAuditLog, OperatorPermission } from "@/features/operators/api/operatorsApi";
|
||||
|
||||
// ─── ActiveIndicator ──────────────────────────────────────────────────────────
|
||||
|
||||
function ActiveIndicator({ active }: { active: boolean }) {
|
||||
return active ? (
|
||||
<CheckCircle2 size={18} className="text-emerald-500" />
|
||||
) : (
|
||||
<XCircle size={18} className="text-destructive" />
|
||||
);
|
||||
return active ? <CheckCircle2 size={18} className="text-emerald-500" /> : <XCircle size={18} className="text-destructive" />;
|
||||
}
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
@@ -64,11 +40,7 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: t("common.id", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold text-sm">
|
||||
{row.original.id}
|
||||
</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-primary font-semibold text-sm">{row.original.id}</span>,
|
||||
size: 80,
|
||||
},
|
||||
{
|
||||
@@ -84,40 +56,13 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "guardName",
|
||||
header: t("roles.fields.guardName", "GUARD NAME"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm">{row.original.guardName}</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.guardName}</span>,
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
header: "",
|
||||
size: 120,
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-center gap-1 justify-end">
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => navigate(`/roles/${row.original.id}`)}
|
||||
>
|
||||
<Eye size={14} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
<Pencil size={13} />
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-destructive"
|
||||
>
|
||||
<Trash2 size={13} />
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
cell: ({ row }) => <TableActions onView={() => navigate(`/roles/${row.original.id}`)} />,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -127,11 +72,7 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: t("common.id", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold text-sm">
|
||||
{row.original.id}
|
||||
</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-primary font-semibold text-sm">{row.original.id}</span>,
|
||||
size: 80,
|
||||
},
|
||||
{
|
||||
@@ -142,9 +83,7 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "guardName",
|
||||
header: t("permissions.fields.guardName", "GUARD NAME"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm">{row.original.guardName}</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.guardName}</span>,
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
@@ -152,11 +91,7 @@ export default function OperatorDetailPage() {
|
||||
size: 60,
|
||||
cell: () => (
|
||||
<div className="flex items-center justify-end">
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-destructive"
|
||||
>
|
||||
<Button size="icon" variant="ghost" className="h-7 w-7 text-muted-foreground hover:text-destructive">
|
||||
<Trash2 size={13} />
|
||||
</Button>
|
||||
</div>
|
||||
@@ -170,11 +105,7 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: t("common.id", "ID"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-semibold text-sm">
|
||||
{row.original.id}
|
||||
</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-primary font-semibold text-sm">{row.original.id}</span>,
|
||||
size: 60,
|
||||
},
|
||||
{
|
||||
@@ -190,16 +121,12 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "district",
|
||||
header: t("branches.fields.district", "ETRAP"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm">{row.original.district}</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.district}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "uniqueCode",
|
||||
header: t("branches.fields.uniqueCode", "UNIKAL BELGI"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm">{row.original.uniqueCode}</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm">{row.original.uniqueCode}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "isActive",
|
||||
@@ -210,29 +137,17 @@ export default function OperatorDetailPage() {
|
||||
{
|
||||
accessorKey: "billingUsernameIbr",
|
||||
header: t("branches.fields.billingIbr", "BILLING ULANYJY ADY"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm font-mono">
|
||||
{row.original.billingUsernameIbr}
|
||||
</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm font-mono">{row.original.billingUsernameIbr}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "billingUsernameSber",
|
||||
header: t("branches.fields.billingSber", "BILLING USERNAME (SBER)"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm font-mono ">
|
||||
{row.original.billingUsernameSber}
|
||||
</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm font-mono ">{row.original.billingUsernameSber}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "billingUsernameVisa",
|
||||
header: t("branches.fields.billingVisa", "BILLING USERNAME (VISA)"),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-sm font-mono ">
|
||||
{row.original.billingUsernameVisa}
|
||||
</span>
|
||||
),
|
||||
cell: ({ row }) => <span className="text-sm font-mono ">{row.original.billingUsernameVisa}</span>,
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
@@ -240,11 +155,7 @@ export default function OperatorDetailPage() {
|
||||
size: 60,
|
||||
cell: () => (
|
||||
<div className="flex items-center justify-end">
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="h-7 w-7 text-muted-foreground hover:text-destructive"
|
||||
>
|
||||
<Button size="icon" variant="ghost" className="h-7 w-7 text-muted-foreground hover:text-destructive">
|
||||
<Trash2 size={13} />
|
||||
</Button>
|
||||
</div>
|
||||
@@ -260,10 +171,7 @@ export default function OperatorDetailPage() {
|
||||
<Skeleton className="h-7 w-64" />
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="bg-card border border-border rounded-xl p-4 flex flex-col gap-3"
|
||||
>
|
||||
<div key={i} className="bg-card border border-border rounded-xl p-4 flex flex-col gap-3">
|
||||
<Skeleton className="h-3 w-24 mb-1" />
|
||||
{Array.from({ length: 3 }).map((_, j) => (
|
||||
<Skeleton key={j} className="h-4 w-full" />
|
||||
@@ -287,18 +195,12 @@ export default function OperatorDetailPage() {
|
||||
}));
|
||||
|
||||
const filteredRoles = (operator.roles ?? []).filter(
|
||||
(r) =>
|
||||
r.name.toLowerCase().includes(roleSearch.toLowerCase()) ||
|
||||
r.code.toLowerCase().includes(roleSearch.toLowerCase()),
|
||||
(r) => r.name.toLowerCase().includes(roleSearch.toLowerCase()) || r.code.toLowerCase().includes(roleSearch.toLowerCase()),
|
||||
);
|
||||
|
||||
const filteredPermissions = (operator.permissions ?? []).filter((p) =>
|
||||
p.name.toLowerCase().includes(permSearch.toLowerCase()),
|
||||
);
|
||||
const filteredPermissions = (operator.permissions ?? []).filter((p) => p.name.toLowerCase().includes(permSearch.toLowerCase()));
|
||||
|
||||
const filteredBranches = (operator.branches ?? []).filter((b) =>
|
||||
b.name.toLowerCase().includes(branchSearch.toLowerCase()),
|
||||
);
|
||||
const filteredBranches = (operator.branches ?? []).filter((b) => b.name.toLowerCase().includes(branchSearch.toLowerCase()));
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
@@ -331,28 +233,16 @@ export default function OperatorDetailPage() {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("operators.sections.basic", "Esasy maglumatlar")}>
|
||||
<InfoRow label={t("common.id", "ID")} value={operator.id} />
|
||||
<InfoRow
|
||||
label={t("operators.fields.username", "Ulanyjy ady")}
|
||||
value={operator.username}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("operators.fields.name", "Ady")}
|
||||
value={operator.name}
|
||||
/>
|
||||
<InfoRow label={t("operators.fields.username", "Ulanyjy ady")} value={operator.username} />
|
||||
<InfoRow label={t("operators.fields.name", "Ady")} value={operator.name} />
|
||||
<InfoRow label={t("operators.fields.isActive", "Işjeň")}>
|
||||
<ActiveIndicator active={operator.isActive} />
|
||||
</InfoRow>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t("operators.sections.contact", "Kontakt")}>
|
||||
<InfoRow
|
||||
label={t("operators.fields.phone", "Telefon")}
|
||||
value={operator.phone ?? "—"}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("operators.fields.email", "E-poçta")}
|
||||
value={operator.email ?? "—"}
|
||||
/>
|
||||
<InfoRow label={t("operators.fields.phone", "Telefon")} value={operator.phone ?? "—"} />
|
||||
<InfoRow label={t("operators.fields.email", "E-poçta")} value={operator.email ?? "—"} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
@@ -372,18 +262,11 @@ export default function OperatorDetailPage() {
|
||||
/* modal aç ya da navigate */
|
||||
}}
|
||||
/>
|
||||
<DataTable
|
||||
columns={roleColumns}
|
||||
data={filteredRoles}
|
||||
getRowId={(r) => String(r.id)}
|
||||
enableRowSelection
|
||||
/>
|
||||
<DataTable columns={roleColumns} data={filteredRoles} getRowId={(r) => String(r.id)} enableRowSelection />
|
||||
</CollapsibleSection>
|
||||
|
||||
{/* ── Rugsatlar ────────────────────────────────────────────────────── */}
|
||||
<CollapsibleSection
|
||||
title={t("operators.sections.permissions", "Rugsatlar")}
|
||||
>
|
||||
<CollapsibleSection title={t("operators.sections.permissions", "Rugsatlar")}>
|
||||
<DataTableToolbar
|
||||
searchValue={permSearch}
|
||||
onSearchChange={setPermSearch}
|
||||
@@ -397,26 +280,14 @@ export default function OperatorDetailPage() {
|
||||
onAction={() => {}}
|
||||
/>
|
||||
{filteredPermissions.length === 0 ? (
|
||||
<EmptyState
|
||||
label={t(
|
||||
"operators.noPermissions",
|
||||
"Berlen kriterýalara Rugsat gabat gelmedi.",
|
||||
)}
|
||||
/>
|
||||
<EmptyState label={t("operators.noPermissions", "Berlen kriterýalara Rugsat gabat gelmedi.")} />
|
||||
) : (
|
||||
<DataTable
|
||||
columns={permissionColumns}
|
||||
data={filteredPermissions}
|
||||
getRowId={(p) => String(p.id)}
|
||||
enableRowSelection
|
||||
/>
|
||||
<DataTable columns={permissionColumns} data={filteredPermissions} getRowId={(p) => String(p.id)} enableRowSelection />
|
||||
)}
|
||||
</CollapsibleSection>
|
||||
|
||||
{/* ── Şahamçalar ───────────────────────────────────────────────────── */}
|
||||
<CollapsibleSection
|
||||
title={t("operators.sections.branches", "Şahamçalar")}
|
||||
>
|
||||
<CollapsibleSection title={t("operators.sections.branches", "Şahamçalar")}>
|
||||
<DataTableToolbar
|
||||
searchValue={branchSearch}
|
||||
onSearchChange={setBranchSearch}
|
||||
@@ -429,18 +300,11 @@ export default function OperatorDetailPage() {
|
||||
actionLabel={t("operators.addBranch", "Şahamça birikdiriň")}
|
||||
onAction={() => {}}
|
||||
/>
|
||||
<DataTable
|
||||
columns={branchColumns}
|
||||
data={filteredBranches}
|
||||
getRowId={(r) => String(r.id)}
|
||||
enableRowSelection
|
||||
/>
|
||||
<DataTable columns={branchColumns} data={filteredBranches} getRowId={(r) => String(r.id)} enableRowSelection />
|
||||
</CollapsibleSection>
|
||||
|
||||
{/* ── Karz sargyt ──────────────────────────────────────────────────── */}
|
||||
<CollapsibleSection
|
||||
title={t("operators.sections.loanLimits", "Karz sargyt")}
|
||||
>
|
||||
<CollapsibleSection title={t("operators.sections.loanLimits", "Karz sargyt")}>
|
||||
<DataTableToolbar
|
||||
searchValue=""
|
||||
onSearchChange={() => {}}
|
||||
@@ -454,19 +318,12 @@ export default function OperatorDetailPage() {
|
||||
hideSearch
|
||||
/>
|
||||
{(operator.loanLimits ?? []).length === 0 && (
|
||||
<EmptyState
|
||||
label={t(
|
||||
"operators.noLoanLimits",
|
||||
"Berlen kriterýalara Karz sargyt gabat gelmedi.",
|
||||
)}
|
||||
/>
|
||||
<EmptyState label={t("operators.noLoanLimits", "Berlen kriterýalara Karz sargyt gabat gelmedi.")} />
|
||||
)}
|
||||
</CollapsibleSection>
|
||||
|
||||
{/* ── Kart sargyt ──────────────────────────────────────────────────── */}
|
||||
<CollapsibleSection
|
||||
title={t("operators.sections.cardLimits", "Kart sargyt")}
|
||||
>
|
||||
<CollapsibleSection title={t("operators.sections.cardLimits", "Kart sargyt")}>
|
||||
<DataTableToolbar
|
||||
searchValue=""
|
||||
onSearchChange={() => {}}
|
||||
@@ -480,12 +337,7 @@ export default function OperatorDetailPage() {
|
||||
hideSearch
|
||||
/>
|
||||
{(operator.cardLimits ?? []).length === 0 && (
|
||||
<EmptyState
|
||||
label={t(
|
||||
"operators.noCardLimits",
|
||||
"Berlen kriterýalara Kart sargyt gabat gelmedi.",
|
||||
)}
|
||||
/>
|
||||
<EmptyState label={t("operators.noCardLimits", "Berlen kriterýalara Kart sargyt gabat gelmedi.")} />
|
||||
)}
|
||||
</CollapsibleSection>
|
||||
|
||||
@@ -496,11 +348,7 @@ export default function OperatorDetailPage() {
|
||||
open={deleteOpen}
|
||||
onOpenChange={setDeleteOpen}
|
||||
title={t("operators.deleteTitle", "Operatory pozmak")}
|
||||
description={t(
|
||||
"operators.deleteConfirm",
|
||||
"{{name}} operatoryny pozmak isleýärsiňizmi?",
|
||||
{ name: operator.name },
|
||||
)}
|
||||
description={t("operators.deleteConfirm", "{{name}} operatoryny pozmak isleýärsiňizmi?", { name: operator.name })}
|
||||
confirmLabel={t("common.delete", "Poz")}
|
||||
onConfirm={() =>
|
||||
deleteMutation.mutate(operatorId, {
|
||||
|
||||
Reference in New Issue
Block a user