import { DataTable as e } from "../data-table/DataTable.js";
import { useCallback as t } from "react";
import { jsx as n } from "react/jsx-runtime";
//#region src/components/lists/ListView.tsx
var r = ({ loading: r, error: i, items: a, totalItems: o, columns: s, filterConfig: c, deleteItem: l, onClick: u, handleNew: d, handleEdit: f, setPage: p, setRowsPerPage: m, setOrderBy: h, setOrder: g, setSearchTerm: _, setFilters: v, orderBy: y, order: b, searchTerm: x = "", filters: S, page: C, rowsPerPage: w, batchActions: T = [], batchDelete: E, enableBatchActions: D = !0, rowActions: O = [], deleteConfirmTitle: k, deleteConfirmDescription: A, newButtonLabel: j }) => {
	let M = s.map((e) => ({
		id: e.id,
		label: e.label,
		minWidth: e.minWidth,
		align: e.align,
		sortable: !0,
		format: e.format ? (t) => {
			let r = e.format(t);
			return typeof r == "string" && r.includes("<") ? /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: r } }) : r;
		} : void 0
	})), N = T.map((e) => ({
		id: e.id,
		label: e.label,
		icon: e.icon,
		variant: e.variant,
		action: e.action
	})), P = O.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
	})), F = t((e) => {
		p(e);
	}, [p]), I = t((e) => {
		m(e), p(0);
	}, [m, p]), L = t((e, t) => {
		h(e), g(t);
	}, [h, g]), R = t((e) => {
		_(e), p(0);
	}, [_, p]), z = t((e) => {
		v(e), p(0);
	}, [v, p]), B = t((e) => {
		u?.(e.id);
	}, [u]), V = t((e) => {
		f?.(e);
	}, [f]), H = t((e) => {
		l?.(e);
	}, [l]), U = t(async (e) => {
		E && await E(e);
	}, [E]);
	return /* @__PURE__ */ n("div", {
		className: "w-full",
		children: /* @__PURE__ */ n(e, {
			data: a,
			columns: M,
			totalItems: o,
			loading: r,
			error: i,
			page: C,
			pageSize: w,
			onPageChange: F,
			onPageSizeChange: I,
			sortBy: y,
			sortOrder: b,
			onSortChange: L,
			searchTerm: x,
			onSearchChange: R,
			filters: S,
			filterConfig: c,
			onFiltersChange: z,
			onRowClick: u ? B : void 0,
			onEdit: f ? V : void 0,
			onDelete: l ? H : void 0,
			onNew: d,
			newButtonLabel: j,
			enableBatchActions: D,
			batchActions: N,
			onBatchDelete: U,
			rowActions: P,
			deleteConfirmTitle: k,
			deleteConfirmDescription: A
		})
	});
};
//#endregion
export { r as default };
