import packageJson from "@/package.json"

const packageVersion = packageJson.version

export function getAppVersion(): string {
  return process.env.NEXT_PUBLIC_APP_VERSION?.trim() || `${packageVersion}-dev`
}

export function formatAppVersionLabel(version = getAppVersion()): string {
  return `v${version}`
}

export function getReleaseUrl(): string | null {
  const value = process.env.NEXT_PUBLIC_RELEASE_URL?.trim()
  return value || null
}
