/** Navigate to unified execution record detail (replaces batch result dialog). */
import type { Router } from 'vue-router'
import { executionRecordPath, type ExecutionRecordKind } from '@/utils/executionRecordRoute'

export function navigateToExecutionRecord(
  router: Router,
  id: number,
  kind: ExecutionRecordKind,
) {
  return router.push(executionRecordPath(id, kind))
}

export async function openServerBatchJobResult(jobId: number, _label?: string) {
  const { default: router } = await import('@/router')
  return navigateToExecutionRecord(router, jobId, 'server_batch')
}
