"use client"; import { getPaymentHistory } from "@/pages/finance/lib/api"; import formatPrice from "@/shared/lib/formatPrice"; import { Button } from "@/shared/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/shared/ui/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/shared/ui/table"; import { useQuery } from "@tanstack/react-query"; import { ChevronLeft, ChevronRightIcon, Loader2 } from "lucide-react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; export function PaymentHistory() { const { t } = useTranslation(); const [page, setPage] = useState(1); const { data, isLoading, isError } = useQuery({ queryKey: ["payment-history", page], queryFn: () => getPaymentHistory({ page, page_size: 10 }), }); if (isLoading) return (
Xatolik yuz berdi. Qayta urinib ko‘ring.
{t("Sahifa")} {history.data.current_page} /{" "} {history.data.total_pages}