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