/**
 * Collaboration form summary row component
 * Full-width styled row for totals, subtotals, and highlighted summary values
 * Does NOT use BaseFieldLayout - it has its own custom layout
 */
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { cn } from '../utils/cn.js';
import { format_currency } from '../utils/financial_format.js';
import { create_style_resolver } from '../utils/style_resolver.js';
/**
 * Collaboration form summary row component
 */
export const HazoCollabFormSummaryRow = React.memo(function HazoCollabFormSummaryRow({ label, value, currency_symbol = '$', decimal_places = 2, format_as_currency = true, style_variant, styles_config, item_code, badge, summary_note, className, field_id, }) {
    // Resolve style from styles_config if available
    let row_style = {};
    if (style_variant && styles_config) {
        const resolver = create_style_resolver(styles_config);
        row_style = resolver.to_style(style_variant);
    }
    // Format value
    let display_value;
    if (format_as_currency) {
        const num = typeof value === 'number' ? value : parseFloat(String(value));
        display_value = !isNaN(num)
            ? format_currency(num, currency_symbol, decimal_places)
            : String(value ?? '');
    }
    else {
        display_value = String(value ?? '');
    }
    return (_jsxs("div", { "data-field-id": field_id, className: cn('cls_collab_summary_row flex items-center justify-between w-full px-4 py-2 rounded', className), style: row_style, children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [item_code && (_jsx("span", { className: "cls_summary_row_item_code inline-flex items-center justify-center px-1.5 py-0.5 border border-current text-xs font-mono flex-shrink-0", children: item_code })), badge && (_jsx("span", { className: "cls_summary_row_badge inline-flex items-center justify-center w-6 h-6 rounded bg-foreground text-background text-xs font-bold flex-shrink-0", children: badge })), _jsx("span", { className: "cls_summary_row_label font-medium truncate", children: label }), summary_note && (_jsxs("span", { className: "text-xs text-muted-foreground italic flex-shrink-0", children: ["(", summary_note, ")"] }))] }), _jsx("span", { className: "cls_summary_row_value font-semibold tabular-nums text-right flex-shrink-0 ml-4", children: display_value })] }));
});
//# sourceMappingURL=hazo_collab_form_summary_row.js.map