started refactor

This commit is contained in:
@jcarymuhammedow
2026-05-08 16:40:10 +05:00
parent ca3d2f6db9
commit c6462b9956
17 changed files with 634 additions and 532 deletions

View File

@@ -149,7 +149,7 @@ export function SberPaymentForm({ mode, initialData, orderId }: SberPaymentFormP
}
return (
<div className="space-y-8 max-w-4xl pb-8">
<div className="space-y-8 pb-8">
{/* Status Section */}
<section className="space-y-4">
<h2 className="text-base font-semibold text-foreground">Status</h2>

View File

@@ -1,59 +0,0 @@
import { cn } from '@/lib/utils'
import type { PaymentStatus, PaymentPaidStatus } from '@/features/sberPayments/api/sberPaymentsApi'
interface StatusBadgeProps {
status: PaymentStatus
className?: string
}
const statusConfig: Record<PaymentStatus, { label: string; className: string }> = {
GARASYLYYAR: {
label: 'Garasylyyar',
className: 'bg-[oklch(0.75_0.18_85)] text-[oklch(0.20_0_0)]',
},
KANAGATLANDYRYLAN: {
label: 'Kanagatlandyrylan',
className: 'bg-[oklch(0.72_0.19_160)] text-[oklch(0.15_0_0)]',
},
RET_EDILEN: {
label: 'Ret edilen',
className: 'bg-destructive text-destructive-foreground',
},
}
export function StatusBadge({ status, className }: StatusBadgeProps) {
const config = statusConfig[status]
return (
<span
className={cn(
'inline-flex items-center px-2 py-0.5 rounded text-xs font-semibold uppercase tracking-wide',
config.className,
className
)}
>
{config.label}
</span>
)
}
interface PaidStatusBadgeProps {
status: PaymentPaidStatus
className?: string
}
export function PaidStatusBadge({ status, className }: PaidStatusBadgeProps) {
const isPaid = status === 'Tolendi'
return (
<span
className={cn(
'inline-flex items-center text-sm',
isPaid ? 'text-primary' : 'text-muted-foreground',
className
)}
>
{status}
</span>
)
}