import React, { useEffect, useState } from 'react';
import { PHXDropdown } from '../Dropdown';
const optionNumber = [150, 125, 100, 75, 50, 25, 10];
function PaginationSelected({ rowQuantity, setCurrentPage, setRowQuantity, router }) {
    const [searchParams, setSearchParams] = useState({});
    useEffect(() => {
        if (typeof window !== 'undefined') {
            const params = new URLSearchParams(window.location.search);
            setSearchParams(params);
        }
    }, []);
    const options = optionNumber.map((item) => ({
        content: item + '',
        active: rowQuantity === item,
        onClick: () => {
            setRowQuantity(item);
            setCurrentPage(1);
            const params = new URLSearchParams(searchParams + '');
            params.set('row', item + '');
            router === null || router === void 0 ? void 0 : router.push(`?${params + ''}`, { scroll: false });
        },
    }));
    return (React.createElement("div", { className: 'flex items-center ' },
        React.createElement(PHXDropdown, { buttonContent: `${rowQuantity}`, options: options, origin: 'top-left', type: 'default' }),
        React.createElement("span", { className: 'mx-1 whitespace-nowrap text-xs' }, "b\u1EA3n ghi/trang")));
}
export default PaginationSelected;
//# sourceMappingURL=PaginaitonSelected.js.map