import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../scalars/lib/utils.js';
const renderDateCell = (value, context) => {
    const formatDate = (dateValue) => {
        if (!dateValue)
            return '';
        try {
            const date = new Date(dateValue);
            if (isNaN(date.getTime()))
                return String(dateValue);
            return date.toLocaleDateString();
        }
        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: formatDate(value) }));
};
export { renderDateCell };
//# sourceMappingURL=date-render.js.map