import { Navigate, useParams } from 'react-router-dom'

/**
 * Permanent 301-style redirect from /assistant/:sessionId to /pilot/:sessionId.
 * Used by the Phase 1 route-rename; paired with a bare-path redirect to /pilot.
 * SPA redirects replace history so the legacy URL does not linger in back-nav.
 */
export function AssistantSessionRedirect() {
  const { sessionId } = useParams<{ sessionId: string }>()
  return <Navigate to={sessionId ? `/pilot/${sessionId}` : '/pilot'} replace />
}
