import { Box, TextButton } from '@wix/design-system';
import React from 'react';
import { useToolbarCollectionContext } from '../ToolbarCollectionContext';
import { wixPatternsSectionHeaderPrimaryActionClicked } from '@wix/bex-core/bi';
export const CollectionSectionHeaderActionBar = ({ sectionId, section, biComponentType, }) => {
    const { toolbarBIReporter } = useToolbarCollectionContext();
    const { primaryAction } = section;
    const handleClick = () => {
        toolbarBIReporter.reportBi(wixPatternsSectionHeaderPrimaryActionClicked({
            sectionId,
            cta: primaryAction?.id,
            componentType: biComponentType,
        }));
        primaryAction?.onClick?.();
    };
    return (React.createElement(Box, { direction: "horizontal" }, primaryAction && (React.createElement(TextButton, { prefixIcon: primaryAction.prefixIcon, dataHook: "collection-section-header-primary-action", onClick: handleClick, size: "small" }, primaryAction.label))));
};
//# sourceMappingURL=CollectionSectionHeaderActionBar.js.map