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