import { jsx as _jsx } from "react/jsx-runtime";
const limitCharacters = (attr, props, max) => {
    const value = props.row.original[attr];
    if (!value)
        return '';
    return value.length > max ? `${value.substr(0, max)}...` : value;
};
const addCenteredHeader = (header) => (_jsx("div", { className: "text-center", children: header }));
const addCenteredCell = (attr, props) => (_jsx("div", { className: "text-center", children: props.row.original[attr] }));
const addEnumBadge = (attr, props, append, t) => {
    const value = props[attr].toLowerCase();
    return (_jsx("span", { className: `badge badge-enum ${attr}-${value}`, children: t(`${append}${value}`) }));
};
const addSimpleCell = (value) => {
    return _jsx("div", { className: "text-center", children: value });
};
const AppTableUtils = {
    limitCharacters,
    addCenteredHeader,
    addCenteredCell,
    addEnumBadge,
    addSimpleCell,
};
export default AppTableUtils;
