@@ -6,10 +6,9 @@ import { useCallback } from "react";
66import { SearchInput } from "~/components/primitives/SearchInput" ;
77import { typedjson , useTypedLoaderData } from "remix-typedjson" ;
88import { BranchEnvironmentIconSmall } from "~/assets/icons/EnvironmentIcons" ;
9- import { BranchesNoBranchableEnvironment } from "~/components/BlankStatePanels" ;
109import { V4Title } from "~/components/V4Badge" ;
1110import { AdminDebugTooltip } from "~/components/admin/debugTooltip" ;
12- import { MainCenteredContainer , PageBody , PageContainer } from "~/components/layout/AppLayout" ;
11+ import { PageBody , PageContainer } from "~/components/layout/AppLayout" ;
1312import { Badge } from "~/components/primitives/Badge" ;
1413import { Button , LinkButton } from "~/components/primitives/Buttons" ;
1514import { CopyableText } from "~/components/primitives/CopyableText" ;
@@ -39,7 +38,6 @@ import {
3938} from "~/components/primitives/Table" ;
4039import { InfoIconTooltip , SimpleTooltip } from "~/components/primitives/Tooltip" ;
4140import { useEnvironment } from "~/hooks/useEnvironment" ;
42- import { useShowSelfServe } from "~/hooks/useShowSelfServe" ;
4341import { useOrganization } from "~/hooks/useOrganizations" ;
4442import { useProject } from "~/hooks/useProject" ;
4543
@@ -52,6 +50,7 @@ import { ArchiveButton } from "../resources.branches.archive";
5250import { NewBranchPanel } from "~/routes/resources.branches.create" ;
5351import { BranchesOptions } from "~/utils/branches" ;
5452import { IconArrowBearRight2 } from "@tabler/icons-react" ;
53+ import { useAutoRevalidate } from "~/hooks/useAutoRevalidate" ;
5554
5655export const loader = async ( { request, params } : LoaderFunctionArgs ) => {
5756 const userId = await requireUserId ( request ) ;
@@ -82,38 +81,20 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
8281
8382export default function Page ( ) {
8483 const {
85- branchableEnvironment,
8684 branches,
87- hasFilters,
8885 limits,
8986 currentPage,
9087 totalPages,
91- hasBranches,
9288 } = useTypedLoaderData < typeof loader > ( ) ;
89+ useAutoRevalidate ( { interval : 5000 } ) ;
9390
9491 const organization = useOrganization ( ) ;
9592 const project = useProject ( ) ;
9693 const environment = useEnvironment ( ) ;
9794
98- const showSelfServe = useShowSelfServe ( ) ;
9995 const atBranchLimit = limits . used >= limits . limit ;
10096 const usageRatio = limits . limit > 0 ? Math . min ( limits . used / limits . limit , 1 ) : 0 ;
10197
102- if ( ! branchableEnvironment ) {
103- return (
104- < PageContainer >
105- < NavBar >
106- < PageTitle title = { < V4Title > Dev branches</ V4Title > } />
107- </ NavBar >
108- < PageBody >
109- < MainCenteredContainer className = "max-w-md" >
110- < BranchesNoBranchableEnvironment showSelfServe = { showSelfServe } />
111- </ MainCenteredContainer >
112- </ PageBody >
113- </ PageContainer >
114- ) ;
115- }
116-
11798 return (
11899 < PageContainer >
119100 < NavBar >
0 commit comments