import { typeDictionary } from '@/consts/instrument.consts';
import flavor from '@/helpers/app-flavor';

const instrumentType = (instrument) => {
  let category;
  if (typeof instrument === 'string') {
    category = instrument;
  } else {
    return instrument.type.category.name;
  }
  return typeDictionary[category] || category || '';
};

const instrumentCategory = (instrument) => {
  return `${flavor.textInstruments} &ndash; ${instrumentType(instrument)}`;
};

export default instrumentType;

export { instrumentCategory, instrumentType };
