import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../scalars/lib/utils.js';
const renderDateTimeCell = (value, context) => {
    const formatDateTime = (dateValue) => {
        if (!dateValue)
            return '';
        try {
            const date = new Date(dateValue);
            if (isNaN(date.getTime()))
                return String(dateValue);
            return date.toLocaleString();
        }
        catch {
            return String(dateValue);
        }
    };
    return (_jsx("div", { className: cn({
            'text-right': context.column.align === 'right',
            'text-center': context.column.align === 'center',
            'text-left': context.column.align === 'left' || !context.column.align,
        }), children: formatDateTime(value) }));
};
export { renderDateTimeCell };
//# sourceMappingURL=datetime-render.js.map