finished card pages
This commit is contained in:
@@ -176,12 +176,17 @@ export default function CardPinsPage() {
|
||||
];
|
||||
|
||||
const columnMeta = columns
|
||||
.filter((c) => "accessorKey" in c && c.id !== "actions")
|
||||
.map((c) => ({
|
||||
id: ("accessorKey" in c ? String(c.accessorKey) : c.id) as string,
|
||||
label:
|
||||
typeof c.header === "string" ? c.header : String(c.accessorKey ?? ""),
|
||||
}));
|
||||
.filter((c) => ("accessorKey" in c || "id" in c) && c.id !== "actions")
|
||||
.map((c) => {
|
||||
const id = ("accessorKey" in c ? String(c.accessorKey) : c.id) as string;
|
||||
const label =
|
||||
typeof c.header === "string"
|
||||
? c.header
|
||||
: "accessorKey" in c
|
||||
? String(c.accessorKey)
|
||||
: id;
|
||||
return { id, label };
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useParams, useNavigate, Link } from 'react-router-dom'
|
||||
import { useParams, useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useCardPin, useDeleteCardPin } from '@/features/cardPins/hooks/useCardPins'
|
||||
import type { CardPinStatus } from '@/features/cardPins/api/cardPinApi'
|
||||
|
||||
@@ -78,7 +78,7 @@ function PassportImageRow({ label, url }: { label: string; url?: string }) {
|
||||
className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-fit"
|
||||
>
|
||||
<DownloadCloud size={13} />
|
||||
{('Download', 'Göçürip al')}
|
||||
{( 'Göçürip al')}
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
|
||||
312
src/pages/internationalPayments/sberPayments/index.tsx
Normal file
312
src/pages/internationalPayments/sberPayments/index.tsx
Normal file
@@ -0,0 +1,312 @@
|
||||
|
||||
import { useState, useMemo } from 'react'
|
||||
import { format } from 'date-fns'
|
||||
import { Eye, Edit, ArrowUpDown, Trash2 } from 'lucide-react'
|
||||
import type { ColumnDef, VisibilityState } from '@tanstack/react-table'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { DataTable } from '@/components/dataTable'
|
||||
import { DataTableToolbar, type ColumnMeta, type FilterField, type ActiveFilter } from '@/components/dataTableToolbar'
|
||||
import { StatusBadge, PaidStatusBadge } from '@/features/sberPayments/components/statusBadge'
|
||||
import { useSberPaymentOrders, useDeleteSberPayment } from '@/features/sberPayments/hooks/useSberPayments'
|
||||
import { WELAYATLAR, STATUSES, type SberPaymentOrder } from '@/features/sberPayments/api/sberPaymentsApi'
|
||||
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select'
|
||||
|
||||
// ─── Column Definitions ───────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
// ─── Column Meta for Toolbar ──────────────────────────────────────────────────
|
||||
|
||||
const columnMeta: ColumnMeta[] = [
|
||||
{ id: 'id', label: 'ID' },
|
||||
{ id: 'createdAt', label: 'Doredilen wagty' },
|
||||
{ id: 'welayat', label: 'Welayat' },
|
||||
{ id: 'sahamca', label: 'Sahamca' },
|
||||
{ id: 'firstName', label: 'Ady' },
|
||||
{ id: 'lastName', label: 'Familiyasy' },
|
||||
{ id: 'phone', label: 'Telefon' },
|
||||
{ id: 'status', label: 'Status' },
|
||||
{ id: 'paidStatus', label: 'Tolenen (sul ay)' },
|
||||
]
|
||||
|
||||
// ─── Filter Fields ────────────────────────────────────────────────────────────
|
||||
|
||||
const filterFields: FilterField[] = [
|
||||
{
|
||||
id: 'welayat',
|
||||
label: 'Welayat',
|
||||
options: WELAYATLAR.map((w) => ({ value: w, label: w })),
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
label: 'Status',
|
||||
options: STATUSES,
|
||||
},
|
||||
]
|
||||
|
||||
// ─── List Page Component ──────────────────────────────────────────────────────
|
||||
|
||||
export default function SberPaymentsListPage() {
|
||||
const navigate = useNavigate()
|
||||
const deleteMutation = useDeleteSberPayment()
|
||||
|
||||
const columns = useMemo<ColumnDef<SberPaymentOrder>[]>(() => [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: ({ column }) => (
|
||||
<button
|
||||
className="flex items-center gap-1 hover:text-foreground transition-colors"
|
||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||
>
|
||||
ID
|
||||
<ArrowUpDown size={12} />
|
||||
</button>
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<span className="font-medium text-foreground">{row.getValue('id')}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: 'createdAt',
|
||||
header: 'Doredilen wagty',
|
||||
cell: ({ row }) => {
|
||||
const date = new Date(row.getValue('createdAt'))
|
||||
return (
|
||||
<div className="text-sm">
|
||||
<div>{format(date, 'HH:mm, dd.MM.yyyy')}</div>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'welayat',
|
||||
header: 'Welayat',
|
||||
cell: ({ row }) => <span>{row.getValue('welayat')}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: 'sahamca',
|
||||
header: ({ column }) => (
|
||||
<button
|
||||
className="flex items-center gap-1 hover:text-foreground transition-colors"
|
||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||
>
|
||||
Sahamca
|
||||
<ArrowUpDown size={12} />
|
||||
</button>
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-medium">{row.getValue('sahamca')}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: 'firstName',
|
||||
header: 'Ady',
|
||||
cell: ({ row }) => <span>{row.getValue('firstName')}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: 'lastName',
|
||||
header: 'Familiyasy',
|
||||
cell: ({ row }) => <span>{row.getValue('lastName')}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: 'phone',
|
||||
header: 'Telefon',
|
||||
cell: ({ row }) => <span className="text-muted-foreground">{row.getValue('phone')}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: 'status',
|
||||
header: ({ column }) => (
|
||||
<button
|
||||
className="flex items-center gap-1 hover:text-foreground transition-colors"
|
||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||
>
|
||||
Status
|
||||
<ArrowUpDown size={12} />
|
||||
</button>
|
||||
),
|
||||
cell: ({ row }) => <StatusBadge status={row.getValue('status')} />,
|
||||
},
|
||||
{
|
||||
accessorKey: 'paidStatus',
|
||||
header: 'Tolenen (sul ay)',
|
||||
cell: ({ row }) => <PaidStatusBadge status={row.getValue('paidStatus')} />,
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
header: '',
|
||||
cell: ({ row }) => {
|
||||
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="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="Edit"
|
||||
>
|
||||
<Edit size={16} />
|
||||
</button>
|
||||
<button
|
||||
onClick={async () => {
|
||||
if (confirm('Bu tolegi pozmak isleyanizmi?')) {
|
||||
await deleteMutation.mutateAsync(order.id)
|
||||
}
|
||||
}}
|
||||
className="p-1.5 rounded hover:bg-accent text-destructive hover:bg-destructive/10 transition-colors"
|
||||
title="Delete"
|
||||
>
|
||||
<Trash2 size={16} />
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
},
|
||||
], [navigate, deleteMutation])
|
||||
|
||||
// Pagination state
|
||||
const [page, setPage] = useState(1)
|
||||
const [perPage, setPerPage] = useState(25)
|
||||
|
||||
// Search state
|
||||
const [search, setSearch] = useState('')
|
||||
|
||||
// Filter state
|
||||
const [activeFilters, setActiveFilters] = useState<ActiveFilter[]>([])
|
||||
|
||||
// Column visibility & order
|
||||
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({})
|
||||
const [columnOrder, setColumnOrder] = useState<string[]>(columnMeta.map((c) => c.id))
|
||||
|
||||
// Month filter
|
||||
const [selectedMonth, setSelectedMonth] = useState<string>('')
|
||||
|
||||
// Get filter values
|
||||
const welayatFilter = activeFilters.find((f) => f.fieldId === 'welayat')?.value ?? ''
|
||||
const statusFilter = activeFilters.find((f) => f.fieldId === 'status')?.value ?? ''
|
||||
|
||||
// Fetch data
|
||||
const { data, isLoading } = useSberPaymentOrders({
|
||||
page,
|
||||
perPage,
|
||||
search,
|
||||
welayat: welayatFilter,
|
||||
status: statusFilter,
|
||||
})
|
||||
|
||||
const handleFilterChange = (fieldId: string, value: string) => {
|
||||
setActiveFilters((prev) => {
|
||||
const existing = prev.find((f) => f.fieldId === fieldId)
|
||||
if (existing) {
|
||||
return prev.map((f) => (f.fieldId === fieldId ? { ...f, value } : f))
|
||||
}
|
||||
return [...prev, { fieldId, value }]
|
||||
})
|
||||
setPage(1)
|
||||
}
|
||||
|
||||
const handleFilterReset = () => {
|
||||
setActiveFilters([])
|
||||
setPage(1)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
{/* Month Filter Card */}
|
||||
<div className="bg-card border border-border rounded-lg p-4 max-w-xs">
|
||||
<label className="block text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2">
|
||||
Ay Tolegi
|
||||
</label>
|
||||
<Select value={selectedMonth} onValueChange={setSelectedMonth}>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="--" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="01">Yanwar</SelectItem>
|
||||
<SelectItem value="02">Fewral</SelectItem>
|
||||
<SelectItem value="03">Mart</SelectItem>
|
||||
<SelectItem value="04">Aprel</SelectItem>
|
||||
<SelectItem value="05">May</SelectItem>
|
||||
<SelectItem value="06">Iýun</SelectItem>
|
||||
<SelectItem value="07">Iýul</SelectItem>
|
||||
<SelectItem value="08">Awgust</SelectItem>
|
||||
<SelectItem value="09">Sentýabr</SelectItem>
|
||||
<SelectItem value="10">Oktýabr</SelectItem>
|
||||
<SelectItem value="11">Noýabr</SelectItem>
|
||||
<SelectItem value="12">Dekabr</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{/* Page Title */}
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
Sber tolegier (talyplar ucin)
|
||||
</h1>
|
||||
|
||||
{/* Toolbar */}
|
||||
<DataTableToolbar
|
||||
searchValue={search}
|
||||
onSearchChange={(val) => {
|
||||
setSearch(val)
|
||||
setPage(1)
|
||||
}}
|
||||
searchPlaceholder="Gozlemek"
|
||||
columns={columnMeta}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
filterFields={filterFields}
|
||||
activeFilters={activeFilters}
|
||||
onFilterChange={handleFilterChange}
|
||||
onFilterReset={handleFilterReset}
|
||||
perPage={perPage}
|
||||
onPerPageChange={(val) => {
|
||||
setPerPage(val)
|
||||
setPage(1)
|
||||
}}
|
||||
actionLabel="Sber toleg (talyplar ucin) doredih"
|
||||
onAction={() => navigate('/sber-payments/create')}
|
||||
/>
|
||||
|
||||
{/* Data Table */}
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={data?.data ?? []}
|
||||
isLoading={isLoading}
|
||||
columnVisibility={columnVisibility}
|
||||
onColumnVisibilityChange={setColumnVisibility}
|
||||
columnOrder={columnOrder}
|
||||
onColumnOrderChange={setColumnOrder}
|
||||
enableRowSelection
|
||||
getRowId={(row) => row.id}
|
||||
currentPage={data?.pagination.currentPage ?? 1}
|
||||
totalPages={data?.pagination.totalPages ?? 1}
|
||||
totalCount={data?.pagination.totalCount ?? 0}
|
||||
onPageChange={setPage}
|
||||
/>
|
||||
|
||||
{/* Pagination Info */}
|
||||
<div className="flex items-center justify-between text-sm text-muted-foreground">
|
||||
<span>
|
||||
{data?.pagination.currentPage && data?.pagination.perPage && data?.pagination.totalCount
|
||||
? `${(data.pagination.currentPage - 1) * data.pagination.perPage + 1}-${Math.min(data.pagination.currentPage * data.pagination.perPage, data.pagination.totalCount)} of ${data.pagination.totalCount}`
|
||||
: ''}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
14
src/pages/internationalPayments/sberPaymentsCreate/index.tsx
Normal file
14
src/pages/internationalPayments/sberPaymentsCreate/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
'use client'
|
||||
|
||||
import { SberPaymentForm } from '@/features/sberPayments/components/sberPaymentsForm'
|
||||
|
||||
export default function SberPaymentCreatePage() {
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-foreground mb-6">
|
||||
Sber toleg (talyplar ucin) doredih
|
||||
</h1>
|
||||
<SberPaymentForm mode="create" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
28
src/pages/internationalPayments/sberPaymentsEdit/index.tsx
Normal file
28
src/pages/internationalPayments/sberPaymentsEdit/index.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { SberPaymentForm } from '@/features/sberPayments/components/sberPaymentsForm'
|
||||
import { useSberPaymentOrder } from '@/features/sberPayments/hooks/useSberPayments'
|
||||
import { Spinner } from '@/components/ui/spinner'
|
||||
|
||||
export default function SberPaymentEditPage() {
|
||||
const params = useParams()
|
||||
const id = params.id as string
|
||||
|
||||
const { data: order, isLoading } = useSberPaymentOrder(id)
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-[400px]">
|
||||
<Spinner className="w-8 h-8" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-foreground mb-6">
|
||||
Sber toleg (talyplar ucin) uytgetmek: {id}
|
||||
</h1>
|
||||
<SberPaymentForm mode="edit" initialData={order} orderId={id} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
352
src/pages/internationalPayments/sberPaymentsView/index.tsx
Normal file
352
src/pages/internationalPayments/sberPaymentsView/index.tsx
Normal file
@@ -0,0 +1,352 @@
|
||||
|
||||
import { format } from 'date-fns'
|
||||
import { Trash2, Edit, Search, Download, Clock } from 'lucide-react'
|
||||
|
||||
import { useSberPaymentOrder, useDeleteSberPayment } from '@/features/sberPayments/hooks/useSberPayments'
|
||||
import { StatusBadge, PaidStatusBadge } from '@/features/sberPayments/components/statusBadge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Spinner } from '@/components/ui/spinner'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useParams, useNavigate } from "react-router-dom";
|
||||
|
||||
// ─── Info Row Component ───────────────────────────────────────────────────────
|
||||
|
||||
function InfoRow({
|
||||
label,
|
||||
value,
|
||||
highlight = false
|
||||
}: {
|
||||
label: string
|
||||
value: React.ReactNode
|
||||
highlight?: boolean
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-start py-2.5 border-b border-border last:border-b-0">
|
||||
<span className="w-64 shrink-0 text-sm text-muted-foreground">{label}</span>
|
||||
<span className={cn(
|
||||
'flex-1 text-sm',
|
||||
highlight ? 'text-primary font-medium' : 'text-foreground'
|
||||
)}>
|
||||
{value || '—'}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// ─── Section Component ────────────────────────────────────────────────────────
|
||||
|
||||
function Section({
|
||||
title,
|
||||
children,
|
||||
className
|
||||
}: {
|
||||
title: string
|
||||
children: React.ReactNode
|
||||
className?: string
|
||||
}) {
|
||||
return (
|
||||
<div className={cn('space-y-1', className)}>
|
||||
<h2 className="text-base font-semibold text-foreground mb-3">{title}</h2>
|
||||
<div className="bg-card rounded-lg border border-border">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// ─── Document Item Component ──────────────────────────────────────────────────
|
||||
|
||||
function DocumentItem({
|
||||
label,
|
||||
fileName,
|
||||
fileUrl
|
||||
}: {
|
||||
label: string
|
||||
fileName: string | null
|
||||
fileUrl: string | null
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-start gap-4 py-3 border-b border-border last:border-b-0 px-4">
|
||||
<span className="w-80 shrink-0 text-sm text-muted-foreground leading-relaxed">
|
||||
{label}
|
||||
</span>
|
||||
<div className="flex-1">
|
||||
{fileUrl ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<button className="p-1.5 rounded bg-muted hover:bg-accent transition-colors">
|
||||
<Search size={14} className="text-muted-foreground" />
|
||||
</button>
|
||||
<button className="p-1.5 rounded bg-muted hover:bg-accent transition-colors">
|
||||
<Download size={14} className="text-muted-foreground" />
|
||||
</button>
|
||||
<span className="px-3 py-1.5 bg-primary/20 text-primary text-xs font-medium rounded">
|
||||
{fileName}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-sm text-muted-foreground">—</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// ─── View Page Component ──────────────────────────────────────────────────────
|
||||
|
||||
export default function SberPaymentViewPage() {
|
||||
const params = useParams()
|
||||
const navigate = useNavigate()
|
||||
const id = params.id as string
|
||||
|
||||
const { data: order, isLoading } = useSberPaymentOrder(id)
|
||||
const deleteMutation = useDeleteSberPayment()
|
||||
|
||||
const handleDelete = async () => {
|
||||
if (confirm('Bu tolegi pozmak isleyanizmi?')) {
|
||||
await deleteMutation.mutateAsync(id)
|
||||
navigate('/sber-payments')
|
||||
}
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-[400px]">
|
||||
<Spinner className="w-8 h-8" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (!order) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center min-h-[400px] text-muted-foreground">
|
||||
<p>Toleg tapylmady</p>
|
||||
<Button variant="outline" onClick={() => navigate('/sber-payments')} className="mt-4">
|
||||
Yza
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6 max-w-4xl">
|
||||
{/* Header Actions */}
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={handleDelete}
|
||||
className="text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
>
|
||||
<Trash2 size={18} />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => navigate(`/sber-payments/${id}/edit`)}
|
||||
>
|
||||
<Edit size={18} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Status Section */}
|
||||
<Section title="Status">
|
||||
<div className="px-4">
|
||||
<InfoRow label="ID" value={order.id} />
|
||||
<InfoRow label="Status" value={<StatusBadge status={order.status} />} />
|
||||
<InfoRow label="Tolenen (Sul ay)" value={<PaidStatusBadge status={order.paidStatus} />} />
|
||||
<InfoRow label="Bellik" value={order.bellik} />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
{/* Location Section */}
|
||||
<Section title="Lokasiya">
|
||||
<div className="px-4">
|
||||
<InfoRow label="Welayat" value={order.welayat} />
|
||||
<InfoRow label="Sahamca" value={order.sahamca} highlight />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
{/* Personal Info Section */}
|
||||
<Section title="Sahsy maglumatlar">
|
||||
<div className="px-4">
|
||||
<InfoRow label="Pasportdaky ady" value={order.firstName} />
|
||||
<InfoRow label="Pasportdaky familiya" value={order.lastName} />
|
||||
<InfoRow label="Telefon" value={order.phone} />
|
||||
<InfoRow label="E-pocta" value={order.email} />
|
||||
<InfoRow label="Hazirki yasayys yeri" value={order.address} />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
{/* Payment Info Section */}
|
||||
<Section title="Toleg">
|
||||
<div className="px-4">
|
||||
<InfoRow
|
||||
label="Tolegi ugradyjynyn maglumatlary"
|
||||
value={`I-M${order.passportNumber?.slice(0, 2) ?? 'XX'}-${order.passportNumber ?? ''} ${order.fullName}`}
|
||||
/>
|
||||
<InfoRow label="Toleg ugradyjynyn goyum hasaby" value={order.accountNumber} />
|
||||
</div>
|
||||
|
||||
<div className="px-4 py-3 bg-muted/30 border-t border-border">
|
||||
<div className="text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2">
|
||||
Tolegi kabul edijinin maglumatlary
|
||||
</div>
|
||||
<div className="grid grid-cols-3 gap-4 text-sm">
|
||||
<div>
|
||||
<span className="text-muted-foreground">Pasport seriyasy</span>
|
||||
<p className="font-medium">{order.passportSeries}</p>
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-muted-foreground">Pasport nomeri</span>
|
||||
<p className="font-medium">{order.passportNumber}</p>
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-muted-foreground">Ady Familiyasy Atasynyn ady</span>
|
||||
<p className="font-medium">{order.fullName}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
{/* Documents - Accepted */}
|
||||
<div className="space-y-3">
|
||||
<h2 className="text-base font-semibold text-foreground">
|
||||
Kabul ediji talyp boyunca resminamalary
|
||||
</h2>
|
||||
<div className="bg-card rounded-lg border border-border">
|
||||
{order.documents?.slice(0, 6).map((doc) => (
|
||||
<DocumentItem
|
||||
key={doc.id}
|
||||
label={doc.label}
|
||||
fileName={doc.name}
|
||||
fileUrl={doc.fileUrl}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Documents - Sent */}
|
||||
<div className="space-y-3">
|
||||
<h2 className="text-base font-semibold text-foreground">
|
||||
Ugradyjy boyunca resminamalary
|
||||
</h2>
|
||||
<div className="bg-card rounded-lg border border-border">
|
||||
{order.documents?.slice(6).map((doc) => (
|
||||
<DocumentItem
|
||||
key={doc.id}
|
||||
label={doc.label}
|
||||
fileName={doc.name}
|
||||
fileUrl={doc.fileUrl}
|
||||
/>
|
||||
)) || (
|
||||
<div className="px-4 py-8 text-center text-muted-foreground text-sm">
|
||||
Resminamalar yok
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Payment History */}
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<h2 className="text-base font-semibold text-foreground">Toleg taryhy</h2>
|
||||
<button className="text-muted-foreground hover:text-foreground transition-colors">
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="currentColor">
|
||||
<path d="M6 0L7.5 4.5L12 6L7.5 7.5L6 12L4.5 7.5L0 6L4.5 4.5L6 0Z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="bg-card rounded-lg border border-border">
|
||||
<div className="flex items-center gap-2 px-4 py-3 border-b border-border">
|
||||
<Search size={14} className="text-muted-foreground" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Gozlemek"
|
||||
className="flex-1 bg-transparent text-sm placeholder:text-muted-foreground/50 focus:outline-none"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-center py-12 text-muted-foreground">
|
||||
<div className="text-center">
|
||||
<div className="w-12 h-12 mx-auto mb-3 rounded-lg bg-muted/50 flex items-center justify-center">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" />
|
||||
<line x1="3" y1="9" x2="21" y2="9" />
|
||||
<line x1="9" y1="21" x2="9" y2="9" />
|
||||
</svg>
|
||||
</div>
|
||||
<p className="text-sm">Berlen kriteriyalara Toleg gabat gelmedi.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-end">
|
||||
<button className="p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors">
|
||||
<Clock size={16} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Activity Log */}
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<h2 className="text-base font-semibold text-foreground">Ammallar</h2>
|
||||
<button className="text-muted-foreground hover:text-foreground transition-colors">
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="currentColor">
|
||||
<path d="M6 0L7.5 4.5L12 6L7.5 7.5L6 12L4.5 7.5L0 6L4.5 4.5L6 0Z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="bg-card rounded-lg border border-border overflow-hidden">
|
||||
{/* Table Header */}
|
||||
<div className="grid grid-cols-6 gap-4 px-4 py-2 bg-muted/40 text-xs font-semibold text-muted-foreground uppercase tracking-wider">
|
||||
<span>ID</span>
|
||||
<span>Analys ady</span>
|
||||
<span>Kim tarapyndan</span>
|
||||
<span>Analys nysany (Targets)</span>
|
||||
<span>Analys statusy</span>
|
||||
<span>Sene</span>
|
||||
</div>
|
||||
|
||||
{/* Table Body */}
|
||||
{order.activityLog?.length ? (
|
||||
order.activityLog.map((log) => (
|
||||
<div key={log.id} className="grid grid-cols-6 gap-4 px-4 py-3 border-t border-border text-sm">
|
||||
<span className="text-primary font-medium">{log.id.split('-')[1] ?? '45384'}</span>
|
||||
<span>{log.analysisName}</span>
|
||||
<span className="text-muted-foreground">{log.createdBy}</span>
|
||||
<span className="text-muted-foreground">{log.target}</span>
|
||||
<span>
|
||||
<span className={cn(
|
||||
'inline-flex items-center px-2 py-0.5 rounded text-xs font-semibold',
|
||||
log.status === 'FINISHED'
|
||||
? 'bg-primary/20 text-primary'
|
||||
: 'bg-muted text-muted-foreground'
|
||||
)}>
|
||||
{log.status}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-muted-foreground">
|
||||
{format(new Date(log.createdAt), 'dd/MM/yyyy, HH:mm:ss')} GMT+5
|
||||
</span>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div className="px-4 py-8 text-center text-muted-foreground text-sm border-t border-border">
|
||||
Ammallar yok
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Pagination */}
|
||||
<div className="flex items-center justify-between text-sm text-muted-foreground">
|
||||
<span>Onki</span>
|
||||
<span>1-1 of 1</span>
|
||||
<span>Indiki</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -185,11 +185,17 @@ export default function IntlPaymentsPage() {
|
||||
]
|
||||
|
||||
const columnMeta = columns
|
||||
.filter((c) => 'accessorKey' in c)
|
||||
.map((c) => ({
|
||||
id: ('accessorKey' in c ? String(c.accessorKey) : c.id) as string,
|
||||
label: typeof c.header === 'string' ? c.header : String(('accessorKey' in c ? c.accessorKey : '') ?? ''),
|
||||
}))
|
||||
.filter((c) => ('accessorKey' in c || 'id' in c) && c.id !== 'actions')
|
||||
.map((c) => {
|
||||
const id = ('accessorKey' in c ? String(c.accessorKey) : c.id) as string
|
||||
const label =
|
||||
typeof c.header === "string"
|
||||
? c.header
|
||||
: "accessorKey" in c
|
||||
? String(c.accessorKey)
|
||||
: id;
|
||||
return { id, label };
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { IntlPaymentForm } from '@/features/visaMasterPayments/components/IntlPaymentForm'
|
||||
import { IntlPaymentForm } from '@/features/visaMasterPayments/components/intlPaymentForm'
|
||||
import { useCreateIntlPayment } from '@/features/visaMasterPayments/hooks/useVisaMasterPayments'
|
||||
import type { IntlPaymentCreatePayload } from '@/features/visaMasterPayments/api/visaMasterPaymentsApi'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useParams, useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { IntlPaymentForm } from '@/features/visaMasterPayments/components/IntlPaymentForm'
|
||||
import { IntlPaymentForm } from '@/features/visaMasterPayments/components/intlPaymentForm'
|
||||
import { useIntlPayment, useUpdateIntlPayment } from '@/features/visaMasterPayments/hooks/useVisaMasterPayments'
|
||||
import type { IntlPaymentUpdatePayload } from '@/features/visaMasterPayments/api/visaMasterPaymentsApi'
|
||||
import { Spinner } from '@/components/ui/spinner'
|
||||
|
||||
Reference in New Issue
Block a user