This commit is contained in:
Samandar Turgunboyev
2026-01-28 13:46:30 +05:00
parent a48a9318c8
commit 711bbe83ca
2 changed files with 5 additions and 7 deletions

View File

@@ -25,7 +25,8 @@ interface Props {
selectedProducts: number[]; selectedProducts: number[];
setSelectedProducts: Dispatch<SetStateAction<number[]>>; setSelectedProducts: Dispatch<SetStateAction<number[]>>;
handleBulkDelete: () => void; handleBulkDelete: () => void;
totalCount?: number; totalCount: number;
count: number;
handleSelectAllPages: () => void; handleSelectAllPages: () => void;
isAllPagesSelected: boolean; isAllPagesSelected: boolean;
} }
@@ -41,7 +42,7 @@ const ProductTable = ({
selectedProducts, selectedProducts,
setSelectedProducts, setSelectedProducts,
handleBulkDelete, handleBulkDelete,
totalCount = 0, totalCount,
handleSelectAllPages, handleSelectAllPages,
isAllPagesSelected, isAllPagesSelected,
}: Props) => { }: Props) => {
@@ -96,9 +97,7 @@ const ProductTable = ({
<div className="mb-4 space-y-2"> <div className="mb-4 space-y-2">
<div className="flex items-center justify-between bg-blue-50 p-4 rounded-lg border border-blue-200"> <div className="flex items-center justify-between bg-blue-50 p-4 rounded-lg border border-blue-200">
<span className="text-sm font-medium text-blue-900"> <span className="text-sm font-medium text-blue-900">
{isAllPagesSelected {`${selectedProducts.length} ta mahsulot tanlandi`}
? `Barcha ${totalCount} ta mahsulot tanlandi`
: `${selectedProducts.length} ta mahsulot tanlandi`}
</span> </span>
<div className="flex gap-2"> <div className="flex gap-2">
{!isAllPagesSelected && totalCount > products.length && ( {!isAllPagesSelected && totalCount > products.length && (

View File

@@ -41,8 +41,6 @@ const ProductList = () => {
setPlanDelete(product); setPlanDelete(product);
}; };
console.log(selectedProducts);
const handleSelectAllPages = async () => { const handleSelectAllPages = async () => {
try { try {
if (!data?.total) return; if (!data?.total) return;
@@ -100,6 +98,7 @@ const ProductList = () => {
<ProductTable <ProductTable
products={data?.results || []} products={data?.results || []}
count={data?.total || 0}
isLoading={isLoading} isLoading={isLoading}
isFetching={isFetching} isFetching={isFetching}
isError={isError} isError={isError}