import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from "react";
import { cn } from "../../lib/utils";
export function FeedbackContextHeader({ segments, className, }) {
    const visibleSegments = segments.filter(Boolean);
    if (visibleSegments.length === 0)
        return null;
    return (_jsx("div", { className: cn("border-border-default text-neutral-grey-50 flex min-h-11 items-center border-b px-4 text-[13px]", className), "data-testid": "feedback-context-header", children: _jsx("div", { className: "min-w-0 truncate", children: visibleSegments.map((segment, index) => (_jsxs(React.Fragment, { children: [index > 0 && (_jsx("span", { className: "text-neutral-grey-50 mx-1", children: ">" })), _jsx("span", { children: segment })] }, `${segment}-${index}`))) }) }));
}
export function FeedbackCardFrame({ children, contextSegments, selected = false, className, bodyClassName, onClick, testId, }) {
    return (_jsxs("div", { "data-testid": testId, className: cn("mb-3 overflow-hidden rounded-2xl border bg-white transition-colors", selected
            ? "border-feedback-blue bg-feedback-blue-light"
            : "border-border-default hover:border-border-default", className), onClick: onClick, children: [_jsx(FeedbackContextHeader, { segments: contextSegments, className: selected ? "border-feedback-blue bg-feedback-blue-light" : undefined }), _jsx("div", { className: cn("px-4 py-4", selected ? "bg-feedback-blue-light" : "bg-white", bodyClassName), children: children })] }));
}
export function getCommentContextSegments(comment, basePageName) {
    const isComponentDifferent = !!comment.itemId && comment.mainItemId !== comment.itemId;
    return [
        basePageName || comment.mainItemName || "",
        isComponentDifferent ? comment.itemName || "" : "",
        comment.fieldName || "",
    ].filter(Boolean);
}
export function getSuggestionContextSegments(suggestion, pageName, itemName, fieldName) {
    return [
        pageName || suggestion.mainItemName || "",
        itemName || suggestion.itemName || "",
        fieldName || "",
    ].filter(Boolean);
}
//# sourceMappingURL=FeedbackCard.js.map