import { toTitleCase } from "../../utilities/input/StringUtilities.mjs";
//#region src/maintenanceEngine/virtualBrowser/VirtualTableColumnDefs.js
const defaultGridColumn = {
	headerName: "",
	field: "",
	minWidth: 80,
	autoHeight: false,
	sortable: true
};
const VirtualTableColumnDefs = (tableDescription, actionList, columnName = "Actions", crudTableActionRenderName = "actionsRenderer", panelDirection = "right") => {
	let columnDefs = tableDescription?.reduce((defs, element) => {
		defs.push({
			...defaultGridColumn,
			headerName: toTitleCase(element?.name || ""),
			field: element?.name
		});
		return defs;
	}, []) || [];
	columnDefs.push({
		headerName: crudTableActionRenderName === "actionsRenderer" ? "Actions" : columnName,
		filter: false,
		pinned: panelDirection,
		width: 150,
		maxWidth: 180,
		cellRenderer: crudTableActionRenderName,
		cellRendererParams: { actionList },
		valueGetter: (params) => params.data,
		suppressMenu: true,
		sortable: false,
		cellStyle: {
			display: "flex",
			alignItems: "center"
		}
	});
	return columnDefs;
};
//#endregion
export { VirtualTableColumnDefs };

//# sourceMappingURL=VirtualTableColumnDefs.mjs.map