bug fix
This commit is contained in:
@@ -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 && (
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user