import { Injectable, inject } from '@angular/core'
import { Configuration } from '../../../../../../libs/data-access/gn4/src'
import { TranslateService } from '@ngx-translate/core'
import { toLang3 } from '../../../../../../libs/util/i18n/src'

@Injectable({
  providedIn: 'root',
})
export class MetadataUrlService {
  private translate = inject(TranslateService)
  private apiConfiguration = inject<Configuration>(Configuration)

  getUrl(uuid: string, apiPath: string = this.apiConfiguration.basePath) {
    const prefix = `${apiPath}/../`
    return `${prefix}${toLang3(
      this.translate.currentLang
    )}/catalog.search#/metadata/${uuid}`
  }
}
