"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { memo } from "react";
import { SVG_SHAPE_CLASSES, getContentInsets } from "./shape-paths.js";
/**
 * Renders the text content of a workflow node: task name and kind badge.
 *
 * For rectangular shapes, renders in a standard flex-column layout.
 * For non-rectangular shapes (diamond, octagon, circle, bar), applies
 * content insets and compact rendering to fit within the inscribed
 * safe area.
 */
export const NodeContent = memo(function NodeContent({ visualClass, taskName, displayName, categoryColor, captionHeight = 0, isNested, }) {
    const isSvgShape = SVG_SHAPE_CLASSES.has(visualClass);
    const insets = getContentInsets(visualClass);
    if (visualClass === "terminal-pill") {
        return (_jsx("span", { className: "text-xs font-medium text-[var(--stgm-foreground,#1a1a2e)]", children: taskName }));
    }
    if (visualClass === "parallel-bar") {
        return (_jsx("span", { className: "truncate text-[11px] font-medium text-[var(--stgm-foreground,#1a1a2e)]", children: taskName }));
    }
    // SVG shapes: task name only, centered inside the shape.
    // The shape outline + category color already communicates the task type.
    if (isSvgShape) {
        const contentWidth = `calc(100% - ${insets.left + insets.right}px)`;
        return (_jsx("div", { className: "flex items-center justify-center overflow-hidden text-center", style: { maxWidth: contentWidth }, children: _jsx("span", { className: "truncate text-xs font-medium leading-tight text-[var(--stgm-foreground,#1a1a2e)]", children: taskName }) }));
    }
    // Rectangular shapes: full text inside
    return (_jsxs("div", { className: "flex flex-1 flex-col gap-0.5 overflow-hidden", children: [_jsx("span", { className: "truncate text-sm font-medium text-[var(--stgm-foreground,#1a1a2e)]", children: taskName }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "inline-block rounded px-1 py-px text-[10px] font-medium leading-tight", style: {
                            color: categoryColor,
                            backgroundColor: `color-mix(in srgb, ${categoryColor} 12%, transparent)`,
                        }, children: displayName }), isNested && (_jsx("span", { className: "text-[10px] text-[var(--stgm-muted-foreground,#737373)]", children: "(nested)" }))] })] }));
});
//# sourceMappingURL=NodeContent.js.map