import * as React from 'react';
import { getConfigData } from '@assets/js-menu/hooks/getConfig';

interface IMenuItemShowAll {
   openItem(): void;
   name?: string;
}

export function ItemBack(props: IMenuItemShowAll) {
   const translations = getConfigData().translations;
   return (
      <li onClick={props.openItem} className="sub-heading toggle-back">
         {MODULES.COMPONENTS ? <i className="c-icon" dangerouslySetInnerHTML={{ __html: require('@assets/icons/resp-sections-prev.svg?raw') }}/> : ''}
         {translations?.back} {getConfigData().config.itemBackWithCategoryName ? props.name ?? '' : ''}
      </li>
   );
}
