import state from "../store";
import cleanAndLowerString from "./cleanAndLowerString";
export default function getServiceTypes({ filterBy, } = {}) {
  const services = filterBy
    ? ((state === null || state === void 0 ? void 0 : state.services) || []).filter(filterBy)
    : (state === null || state === void 0 ? void 0 : state.services) || [];
  return [
    ...new Set(services.map((service) => cleanAndLowerString(service === null || service === void 0 ? void 0 : service.tab))),
  ]
    .sort((a, b) => (a > b ? 1 : -1))
    .filter((value) => value === null || value === void 0 ? void 0 : value.length)
    .map((value) => ({
    label: value,
    value,
  }));
}
