import { CollectionPageState, WixPatternsContainer } from '@wix/bex-core';
import { MoreActionsItem } from '../MoreActions';
import React from 'react';
import { AdjustSmall } from '@wix/wix-ui-icons-common';

export function manageCustomFieldsPageAction({
  pageState,
  container,
}: {
  pageState: CollectionPageState;
  container: WixPatternsContainer;
}): MoreActionsItem {
  const { translate: t } = container;
  return {
    biName: 'manage-custom-fields',
    dataHook: 'manage-custom-fields',
    text: t('cairo.customFields.manageFields.title'),
    prefixIcon: <AdjustSmall />,
    onClick: () => {
      pageState.primaryToolbar?.panels.openSidePanel('customFields');
    },
  };
}
