@@ -4,8 +4,13 @@ import {
4
4
Icon ,
5
5
} from "@rivet-gg/icons" ;
6
6
import { useInfiniteQuery } from "@tanstack/react-query" ;
7
- import { Link , useNavigate } from "@tanstack/react-router" ;
7
+ import {
8
+ Link ,
9
+ type LinkComponentProps ,
10
+ useNavigate ,
11
+ } from "@tanstack/react-router" ;
8
12
import { Fragment } from "react" ;
13
+ import { match } from "ts-pattern" ;
9
14
import { Button , cn , Skeleton } from "@/components" ;
10
15
import { ACTORS_PER_PAGE , useManager } from "@/components/actors" ;
11
16
import { VisibilitySensor } from "@/components/visibility-sensor" ;
@@ -14,7 +19,7 @@ export function ActorBuildsList() {
14
19
const { data, isLoading, hasNextPage, fetchNextPage, isFetchingNextPage } =
15
20
useInfiniteQuery ( useManager ( ) . buildsQueryOptions ( ) ) ;
16
21
17
- const navigate = useNavigate ( { from : "/" } ) ;
22
+ const navigate = useNavigate ( ) ;
18
23
19
24
return (
20
25
< div className = "h-full" >
@@ -41,10 +46,15 @@ export function ActorBuildsList() {
41
46
size = "sm"
42
47
onClick = { ( ) => {
43
48
navigate ( {
44
- to :
45
- __APP_TYPE__ === "engine"
46
- ? "/ns/$namespace"
47
- : "/" ,
49
+ to : match ( __APP_TYPE__ )
50
+ . with ( "engine" , ( ) => "/ns/$namespace" )
51
+ . with (
52
+ "cloud" ,
53
+ ( ) =>
54
+ "/orgs/$organization/projects/$project/ns/$namespace" ,
55
+ )
56
+ . otherwise ( ( ) => "/" ) ,
57
+
48
58
search : ( old ) => ( {
49
59
...old ,
50
60
n : [ build . name ] ,
0 commit comments