import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../scalars/lib/utils.js';
import { getTextAlignmentClasses } from './utils.js';
const renderAmountCell = (value, context) => {
    const formatAmount = (rawValue) => {
        if (typeof rawValue === 'object' && rawValue !== null && 'value' in rawValue) {
            const amount = rawValue;
            if (amount.value !== undefined && amount.unit) {
                return `${amount.value} ${amount.unit}`;
            }
            if (amount.value !== undefined) {
                return amount.value.toString();
            }
        }
        if (typeof rawValue === 'number') {
            return rawValue.toString();
        }
        return '';
    };
    return _jsx("div", { className: cn(getTextAlignmentClasses(context), 'font-semibold'), children: formatAmount(value) });
};
export { renderAmountCell };
//# sourceMappingURL=amount-render.js.map