import { Button } from "../ui/button.js";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select.js";
import { c } from "react/compiler-runtime";
import { jsx, jsxs } from "react/jsx-runtime";
import { ChevronLeft, ChevronRight } from "lucide-react";
var DataTablePagination_default = (f) => {
	let p = c(39), { page: m, pageSize: h, totalItems: g, onPageChange: _, onPageSizeChange: v } = f, y = Math.ceil(g / h), b = m * h + 1, x = Math.min((m + 1) * h, g), S;
	p[0] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx("span", {
		className: "text-muted-foreground text-sm",
		children: "Rows per page"
	}), p[0] = S) : S = p[0];
	let C;
	p[1] === h ? C = p[2] : (C = h.toString(), p[1] = h, p[2] = C);
	let w;
	p[3] === v ? w = p[4] : (w = (t) => v(parseInt(t)), p[3] = v, p[4] = w);
	let T;
	p[5] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ jsx(SelectTrigger, {
		className: "w-24",
		children: /* @__PURE__ */ jsx(SelectValue, {})
	}), p[5] = T) : T = p[5];
	let E;
	p[6] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx(SelectContent, { children: [
		5,
		10,
		25,
		50
	].map(_temp) }), p[6] = E) : E = p[6];
	let D;
	p[7] !== C || p[8] !== w ? (D = /* @__PURE__ */ jsxs("div", {
		className: "flex items-center space-x-2",
		children: [S, /* @__PURE__ */ jsxs(Select, {
			value: C,
			onValueChange: w,
			children: [T, E]
		})]
	}), p[7] = C, p[8] = w, p[9] = D) : D = p[9];
	let O;
	p[10] !== x || p[11] !== b || p[12] !== g ? (O = /* @__PURE__ */ jsxs("div", {
		className: "text-muted-foreground text-sm",
		children: [
			b,
			"-",
			x,
			" of ",
			g,
			" items"
		]
	}), p[10] = x, p[11] = b, p[12] = g, p[13] = O) : O = p[13];
	let k;
	p[14] !== _ || p[15] !== m ? (k = () => _(m - 1), p[14] = _, p[15] = m, p[16] = k) : k = p[16];
	let A = m === 0, j;
	p[17] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }), p[17] = j) : j = p[17];
	let M;
	p[18] !== k || p[19] !== A ? (M = /* @__PURE__ */ jsx(Button, {
		variant: "outline",
		size: "sm",
		onClick: k,
		disabled: A,
		children: j
	}), p[18] = k, p[19] = A, p[20] = M) : M = p[20];
	let N = g === 0 ? 0 : m + 1, P;
	p[21] !== N || p[22] !== y ? (P = /* @__PURE__ */ jsxs("span", {
		className: "text-sm",
		children: [
			"Page ",
			N,
			" of ",
			y
		]
	}), p[21] = N, p[22] = y, p[23] = P) : P = p[23];
	let F;
	p[24] !== _ || p[25] !== m ? (F = () => _(m + 1), p[24] = _, p[25] = m, p[26] = F) : F = p[26];
	let I = m >= y - 1, L;
	p[27] === Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }), p[27] = L) : L = p[27];
	let R;
	p[28] !== F || p[29] !== I ? (R = /* @__PURE__ */ jsx(Button, {
		variant: "outline",
		size: "sm",
		onClick: F,
		disabled: I,
		children: L
	}), p[28] = F, p[29] = I, p[30] = R) : R = p[30];
	let z;
	p[31] !== M || p[32] !== P || p[33] !== R ? (z = /* @__PURE__ */ jsxs("div", {
		className: "flex items-center space-x-2",
		children: [
			M,
			P,
			R
		]
	}), p[31] = M, p[32] = P, p[33] = R, p[34] = z) : z = p[34];
	let B;
	return p[35] !== z || p[36] !== D || p[37] !== O ? (B = /* @__PURE__ */ jsxs("div", {
		className: "mt-4 flex items-center justify-between",
		children: [
			D,
			O,
			z
		]
	}), p[35] = z, p[36] = D, p[37] = O, p[38] = B) : B = p[38], B;
};
function _temp(t) {
	return /* @__PURE__ */ jsx(SelectItem, {
		value: t.toString(),
		children: t
	}, t);
}
export { DataTablePagination_default as default };
