import { Service, ServiceParams } from "./service";
import { Facebook } from "./facebook";
import { Signal } from "./signal";
import { Whatsapp } from "./whatsapp";

export const getService = ({ params: { service } }: ServiceParams): Service => {
  if (service === "facebook") {
    return new Facebook();
  } else if (service === "signal") {
    return new Signal();
  } else if (service === "whatsapp") {
    return new Whatsapp();
  }

  throw new Error("Service not found");
};
