| da0f651 | | | 1 | "use client"; |
| 80fafdf | | | 2 | |
| da0f651 | | | 3 | import { useParams } from "next/navigation"; |
| da0f651 | | | 4 | import { useEffect } from "react"; |
| 80fafdf | | | 5 | |
| 9d879c0 | | | 6 | export default function BuildsRedirect() { |
| da0f651 | | | 7 | const { owner, repo } = useParams<{ owner: string; repo: string }>(); |
| 80fafdf | | | 8 | |
| da0f651 | | | 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}`; |
| a011f1e | | | 13 | const search = window.location.search; |
| a011f1e | | | 14 | const hash = window.location.hash; |
| 9d879c0 | | | 15 | window.location.replace(`${protocol}//${canopyHost}/${owner}/${repo}/builds${search}${hash}`); |
| da0f651 | | | 16 | }, [owner, repo]); |
| 818dc90 | | | 17 | |
| da0f651 | | | 18 | return ( |
| da0f651 | | | 19 | <p className="text-sm py-8 text-center" style={{ color: "var(--text-faint)" }}> |
| da0f651 | | | 20 | Redirecting to Canopy... |
| da0f651 | | | 21 | </p> |
| da0f651 | | | 22 | ); |
| 80fafdf | | | 23 | } |