SI detail page cretaed

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-04-07 16:40:28 +05:00
parent b09e2ebc59
commit 8f75349297
6 changed files with 439 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
'use client';
import React from 'react';
import { Download, CreditCard } from 'lucide-react';
import { Download, CreditCard, Eye } from 'lucide-react';
import { useMutation } from '@tanstack/react-query';
import { useSiHistory } from '../../lib/hooks/useSiHistory';
import { formatDate } from '@/widgets/history/lib/utils';
@@ -9,6 +9,7 @@ import { links } from '@/shared/request/links';
import { toast } from 'react-toastify';
import type { SiDocument } from '../../lib/types';
import { SiButton } from '@/features/modals/siModal/page';
import { useRouter, useParams } from 'next/navigation';
// ─── State badge ───────────────────────────────────────────────────────────────
@@ -89,6 +90,9 @@ const SiRow: React.FC<{ item: SiDocument; index: number }> = ({
item,
index,
}) => {
const router = useRouter();
const { locale } = useParams() as { locale: string };
const pay = useMutation({
mutationKey: ['si-payment', item.id],
mutationFn: () =>
@@ -168,7 +172,13 @@ const SiRow: React.FC<{ item: SiDocument; index: number }> = ({
{pay.isPending ? '...' : "To'lash"}
</button>
) : (
<span className="text-slate-300 text-xs"></span>
<button
onClick={() => router.push(`/${locale}/si/${item.id}`)}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-blue-600 bg-blue-50 hover:bg-blue-100 active:scale-95 transition-all duration-150"
>
<Eye size={11} />
Ko&apos;rish
</button>
)}
</td>
</tr>