import { ListTree, MessageCircle, Plus } from 'lucide-react'
import Link from 'next/link'
import {
Button,
cn,
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
ScrollArea,
} from 'ui'
import { BranchLink } from './BranchLink'
import type { Branch } from '@/data/branches/branches-query'
import { useTrack } from '@/lib/telemetry/track'
const BRANCHING_GITHUB_DISCUSSION_LINK = 'https://github.com/orgs/briven/discussions/18937'
export interface BranchDropdownCommandContentProps {
embedded: boolean
className?: string
branchList: Branch[]
selectedBranch: Branch | undefined
branchesCount: number
isBranchingEnabled: boolean
projectRef: string | undefined
onClose: () => void
onCreateBranch: () => void
}
export function BranchDropdownCommandContent({
embedded,
className,
branchList,
selectedBranch,
branchesCount,
isBranchingEnabled,
projectRef,
onClose,
onCreateBranch,
}: BranchDropdownCommandContentProps) {
const track = useTrack()
if (embedded) {
return (
}
>
Manage branches
}
>
Branching feedback
{isBranchingEnabled && (
)}
{isBranchingEnabled && No branches found}
{branchList.map((branch) => (
))}
)
}
return (
{isBranchingEnabled && }
{isBranchingEnabled && No branches found}
{branchList.map((branch) => (
))}
{
track('branch_selector_create_clicked')
onClose()
onCreateBranch()
}}
>
{
track('branch_selector_manage_clicked')
onClose()
}}
>
Manage branches
{
onClose()
window?.open(BRANCHING_GITHUB_DISCUSSION_LINK, '_blank')?.focus()
}}
onClick={onClose}
>
Branching feedback
Join GitHub Discussion
)
}