export function formatDataAiAppLink(appUrl: string): string {
  const regex = /https:\/\/api\.data\.ai\/v\d+\.\d+/g;
  const replacement = 'https://data.ai';
  const formattedUrl = appUrl.replace(regex, replacement);

  return formattedUrl;
}

export function formatPublisherLink(appUrl: string): string {
  const regex =
    /https:\/\/api\.data\.ai\/v\d+\.\d+\/publisher\/([^\/]+)\/(\d+)\/apps\?.*/;
  const replacement = 'https://www.data.ai/apps/$1/publisher/$2?';
  const formattedUrl = appUrl.replace(regex, replacement);

  return formattedUrl;
}
