import { DataList as e } from "../data-table/DataList.js";
import { useCallback as t } from "react";
import { jsx as n } from "react/jsx-runtime";
//#region src/components/lists/CustomListView.tsx
var r = ({ loading: r, error: i, items: a, totalItems: o, filterConfig: s, onClick: c, handleNew: l, setPage: u, setRowsPerPage: d, setSearchTerm: f, setFilters: p, searchTerm: m = "", filters: h, page: g, rowsPerPage: _, batchActions: v = [], batchDelete: y, enableBatchActions: b = !0, rowActions: x = [], itemRenderer: S, newButtonLabel: C }) => {
	let w = v.map((e) => ({
		id: e.id,
		label: e.label,
		icon: e.icon,
		variant: e.variant,
		action: e.action
	})), T = x.map((e) => ({
		id: e.id,
		label: e.label,
		icon: e.icon,
		variant: e.variant,
		action: e.action,
		condition: e.condition,
		disabled: e.disabled,
		className: e.className
	})), E = t((e) => {
		u(e);
	}, [u]), D = t((e) => {
		d(e), u(0);
	}, [d, u]), O = t((e) => {
		f?.(e), u(0);
	}, [f, u]), k = t((e) => {
		p?.(e), u(0);
	}, [p, u]), A = t((e) => {
		c(e.id);
	}, [c]), j = t(async (e) => {
		y && await y(e);
	}, [y]);
	return /* @__PURE__ */ n("div", {
		className: "w-full",
		children: /* @__PURE__ */ n(e, {
			data: a,
			totalItems: o,
			loading: r,
			error: i,
			page: g,
			pageSize: _,
			onPageChange: E,
			onPageSizeChange: D,
			searchTerm: m,
			onSearchChange: f ? O : void 0,
			filters: h,
			filterConfig: s,
			onFiltersChange: p ? k : void 0,
			onRowClick: A,
			onNew: l,
			enableBatchActions: b,
			batchActions: w,
			onBatchDelete: j,
			rowActions: T,
			itemRenderer: S,
			newButtonLabel: C
		})
	});
};
//#endregion
export { r as default };
