Files
Francesco Sansalvadore b997b7fb13 feat(studio): org project branch mobile selector (#43238)
- add new
[OrgSelector](https://github.com/supabase/supabase/pull/43238/changes#diff-214b339101a9c06864ea2755ac7246eb4c971ce74c5d3169b1385a28ee1d4227)
and
[ProjectBranchSelector](https://github.com/supabase/supabase/pull/43238/changes#diff-82d25c128c306b61bea7481026f58f670a229874f23ca3a1a1d78ddeabde21e0)
components to the mobile navigation, replacing the previous which took
up a lot of horizontal space
- org/project/branch dropdowns now open up in the bottom MobileSheetNav
for a better mobile ux
- desktop nav remains unchanged
2026-03-11 16:25:22 +01:00

40 lines
771 B
TypeScript

import type { Branch } from 'data/branches/branches-query'
import { Badge } from 'ui'
interface BranchBadgeProps {
branch: Branch | undefined
isBranchingEnabled: boolean
}
export function BranchBadge({ branch, isBranchingEnabled }: BranchBadgeProps) {
if (!isBranchingEnabled) {
return (
<Badge variant="warning" className="mt-[1px]">
Production
</Badge>
)
}
if (branch?.is_default) {
return (
<Badge variant="warning" className="mt-[1px]">
Production
</Badge>
)
}
if (branch?.persistent) {
return (
<Badge variant="success" className="mt-[1px]">
Persistent
</Badge>
)
}
return (
<Badge variant="success" className="mt-[1px]">
Preview
</Badge>
)
}