import { forwardRef, type ComponentPropsWithRef } from 'react';
import { translate as _t } from '@assets/js-shop/ShopUtils';

export type ShowAllFilterValuesProps = Omit<ComponentPropsWithRef<'button'>, 'children'> & {
   count: number;
};

export const ShowAllFilterValues = forwardRef<
   HTMLButtonElement,
   ShowAllFilterValuesProps
>((props, ref) => {
   const { count, className, ...restProps } = props;

   return (
      <button
         className={`btn btn-link-reset${className ? ` ${className}` : ''}`}
         ref={ref}
         {...restProps}
      >
         + {count} {_t('filters.showAllValues')}
      </button>
   );
});
