import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../scalars/lib/utils.js';
import { getTextAlignmentClasses } from './utils.js';
const renderDateTimeCell = (value, context) => {
    const formatDateTime = (dateValue) => {
        if (!dateValue)
            return '';
        try {
            const date = new Date(dateValue);
            if (isNaN(date.getTime()))
                return typeof dateValue === 'string' ? dateValue : '';
            return date.toLocaleString();
        }
        catch {
            return typeof dateValue === 'string' ? dateValue : '';
        }
    };
    return _jsx("div", { className: cn(getTextAlignmentClasses(context), 'font-semibold'), children: formatDateTime(value) });
};
export { renderDateTimeCell };
//# sourceMappingURL=datetime-render.js.map