| 80fafdf | | | 1 | "use client"; |
| 80fafdf | | | 2 | |
| 80fafdf | | | 3 | import { useParams } from "next/navigation"; |
| da0f651 | | | 4 | import { useEffect } from "react"; |
| 80fafdf | | | 5 | |
| 9d879c0 | | | 6 | export default function BuildRunRedirect() { |
| da0f651 | | | 7 | const { owner, repo, runId } = useParams<{ owner: string; repo: string; runId: string }>(); |
| 80fafdf | | | 8 | |
| 80fafdf | | | 9 | useEffect(() => { |
| da0f651 | | | 10 | const host = window.location.host; |
| da0f651 | | | 11 | const protocol = window.location.protocol; |
| da0f651 | | | 12 | const canopyHost = host.startsWith("canopy.") ? host : `canopy.${host}`; |
| 9d879c0 | | | 13 | window.location.replace(`${protocol}//${canopyHost}/${owner}/${repo}/builds/${runId}`); |
| 80fafdf | | | 14 | }, [owner, repo, runId]); |
| 80fafdf | | | 15 | |
| 80fafdf | | | 16 | return ( |
| da0f651 | | | 17 | <p className="text-sm py-8 text-center" style={{ color: "var(--text-faint)" }}> |
| da0f651 | | | 18 | Redirecting to Canopy... |
| da0f651 | | | 19 | </p> |
| 80fafdf | | | 20 | ); |
| 80fafdf | | | 21 | } |