import { Button } from "../ui/button.js";
import { Badge } from "../ui/badge.js";
import { Input } from "../ui/input.js";
import { c } from "react/compiler-runtime";
import { jsx, jsxs } from "react/jsx-runtime";
import { Filter, Plus, Search, X } from "lucide-react";
var DataTableToolbar_default = (d) => {
	let f = c(21), { searchTerm: p, onSearchChange: m, onFilterToggle: h, onNew: g, filterCount: _, isFilterOpen: v, newButtonLabel: y, showFilter: b, showSearch: x, children: S } = d, C = p === void 0 ? "" : p, w;
	f[0] === S ? w = f[1] : (w = /* @__PURE__ */ jsx("div", {
		className: "flex w-full items-center justify-between",
		children: S
	}), f[0] = S, f[1] = w);
	let T;
	f[2] !== m || f[3] !== C || f[4] !== x ? (T = x ? /* @__PURE__ */ jsxs("div", {
		className: "relative",
		children: [
			/* @__PURE__ */ jsx(Search, { className: "text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform" }),
			/* @__PURE__ */ jsx(Input, {
				placeholder: "Search...",
				value: C,
				onChange: (i) => m && m(i.target.value),
				className: "w-64 pl-10"
			}),
			C && /* @__PURE__ */ jsx(Button, {
				variant: "ghost",
				size: "sm",
				className: "absolute top-1/2 right-1 h-6 w-6 -translate-y-1/2 transform p-0",
				onClick: () => m && m(""),
				children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
			})
		]
	}) : "", f[2] = m, f[3] = C, f[4] = x, f[5] = T) : T = f[5];
	let E;
	f[6] !== _ || f[7] !== v || f[8] !== h || f[9] !== b ? (E = b ? /* @__PURE__ */ jsxs(Button, {
		variant: v ? "default" : "outline",
		size: "sm",
		onClick: h,
		className: "relative",
		children: [
			/* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
			"Filters",
			_ > 0 && /* @__PURE__ */ jsx(Badge, {
				variant: "secondary",
				className: "ml-2 flex h-5 w-5 items-center justify-center p-0 text-xs",
				children: _
			})
		]
	}) : "", f[6] = _, f[7] = v, f[8] = h, f[9] = b, f[10] = E) : E = f[10];
	let D;
	f[11] !== y || f[12] !== g ? (D = g && /* @__PURE__ */ jsxs(Button, {
		size: "sm",
		onClick: g,
		children: [/* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }), y ?? "New"]
	}), f[11] = y, f[12] = g, f[13] = D) : D = f[13];
	let O;
	f[14] !== T || f[15] !== E || f[16] !== D ? (O = /* @__PURE__ */ jsxs("div", {
		className: "flex items-center gap-2",
		children: [
			T,
			E,
			D
		]
	}), f[14] = T, f[15] = E, f[16] = D, f[17] = O) : O = f[17];
	let k;
	return f[18] !== w || f[19] !== O ? (k = /* @__PURE__ */ jsxs("div", {
		className: "mb-4 flex items-center justify-between",
		children: [w, O]
	}), f[18] = w, f[19] = O, f[20] = k) : k = f[20], k;
};
export { DataTableToolbar_default as default };
