import { env } from "~/env.mjs";

export const createSrcset = (url_immagini: string[]) => {
  const finalSrcset = [];
  for (const url of url_immagini) {
    //finalSrcset.push(`https://${env.BACKENDSERVER_URL}/images/get/${url}`);
    finalSrcset.push(`/go-api/images/get/${url}`);
  }
  return finalSrcset;
};

export const createSrc = (immagine: string, ext?: boolean) => {
  return `${ext ? "https://infoalloggi.it" : env.NEXT_PUBLIC_BASE_URL}/go-api/images/get/${immagine}`;
};
