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[];
setSelectedProducts: Dispatch<SetStateAction<number[]>>;
handleBulkDelete: () => void;
totalCount?: number;
totalCount: number;
count: number;
handleSelectAllPages: () => void;
isAllPagesSelected: boolean;
}
@@ -41,7 +42,7 @@ const ProductTable = ({
selectedProducts,
setSelectedProducts,
handleBulkDelete,
totalCount = 0,
totalCount,
handleSelectAllPages,
isAllPagesSelected,
}: Props) => {
@@ -96,9 +97,7 @@ const ProductTable = ({
<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">
<span className="text-sm font-medium text-blue-900">
{isAllPagesSelected
? `Barcha ${totalCount} ta mahsulot tanlandi`
: `${selectedProducts.length} ta mahsulot tanlandi`}
{`${selectedProducts.length} ta mahsulot tanlandi`}
</span>
<div className="flex gap-2">
{!isAllPagesSelected && totalCount > products.length && (

View File

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