Files
supabase/apps/studio/components/layouts/BranchLayout/BranchLayout.tsx
T
Saxon FletcherandJoshen Lim 1cc7124213 Branches page (#37080)
* move branches to page layout

* changes

* more clean up

* use branch status

* clean up

* gitless flag

* tidy up

* revert generate

* Couple of fixes

* Refactor some stuff, standardize copy, add missing loading state

* Smol refactor

* Replace ephemeral with preview for more consistant language

* Few more fixes

* Refactor Overview.tsx to use DropdownMenuItemTooltip component

* Final round of refactors after code review

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-07-14 17:41:06 +10:00

41 lines
1.2 KiB
TypeScript

import { useRouter } from 'next/router'
import { PropsWithChildren } from 'react'
import { useParams } from 'common'
import { GitHubStatus } from 'components/interfaces/Settings/Integrations/GithubIntegration/GitHubStatus'
import { ProductMenu } from 'components/ui/ProductMenu'
import { withAuth } from 'hooks/misc/withAuth'
import ProjectLayout from '../ProjectLayout/ProjectLayout'
import { generateBranchMenu } from './BranchLayout.utils'
const BranchProductMenu = () => {
const router = useRouter()
const { ref: projectRef = 'default' } = useParams()
const page = router.pathname.split('/')[4] ?? 'branches'
return (
<>
<ProductMenu page={page} menu={generateBranchMenu(projectRef)} />
<div className="px-6">
<h3 className="text-sm font-mono text-foreground-lighter uppercase mb-3">Configure</h3>
<GitHubStatus />
</div>
</>
)
}
const BranchLayout = ({ children }: PropsWithChildren<{}>) => {
return (
<ProjectLayout
title="Branching"
product="Branching"
productMenu={<BranchProductMenu />}
isBlocking={false}
>
{children}
</ProjectLayout>
)
}
export default withAuth(BranchLayout)