import { InfoIcon, listItemSectionBuilder, listItemSelectBuilder, } from '@wix/design-system';
import { PREDEFINED_VIEWS_ID, } from '../../index';
import React from 'react';
export function getCategoryName({ category, viewsState, }) {
    const { translate: t } = viewsState.collection;
    if (category.id === PREDEFINED_VIEWS_ID) {
        return t('cairo.viewDropdown.category.predefinedViews');
    }
    return category.name;
}
export function buildCategoryOption({ viewsState, category, }) {
    const { translate: t } = viewsState.collection;
    const categoryName = getCategoryName({ category, viewsState });
    return listItemSectionBuilder({
        id: category.id,
        title: categoryName,
        type: 'subheader',
        dataHook: 'view-category',
        suffix: (React.createElement(InfoIcon, { size: "small", content: t('cairo.viewDropdown.category.info'), tooltipProps: { maxWidth: 240 } })),
    });
}
export function getViewName({ view, }) {
    if (view.name.length > 0) {
        return view.name;
    }
    return '';
}
export function buildViewOption({ viewsState, view, suffix, }) {
    const viewName = getViewName({ view, viewsState });
    return listItemSelectBuilder({
        id: view.id,
        title: viewName,
        label: viewName,
        dataHook: 'view-item',
        suffix,
    });
}
//# sourceMappingURL=viewsDropdownRenderHelpers.js.map