import { useParams } from 'common' import { EmptyIntegrationConnection, IntegrationConnection, } from 'components/interfaces/Integrations/IntegrationPanels' import type { GitHubConnection } from 'data/integrations/github-connections-query' import { useSelectedOrganization } from 'hooks' import { useSidePanelsStateSnapshot } from 'state/side-panels' import { Badge, Button, FormControl_Shadcn_, FormField_Shadcn_, FormItem_Shadcn_, FormMessage_Shadcn_, IconCheck, IconLoader, Input_Shadcn_, Modal, } from 'ui' interface GithubRepositorySelectionProps { form: any isChecking: boolean isValid: boolean githubConnection?: GitHubConnection } const GithubRepositorySelection = ({ form, isChecking, isValid, githubConnection, }: GithubRepositorySelectionProps) => { const { ref } = useParams() const org = useSelectedOrganization() const sidePanels = useSidePanelsStateSnapshot() function onSelectConnectRepo() { sidePanels.setGithubConnectionsOpen(true) } return (
Git Connection
{githubConnection !== undefined ? 'Your database preview branches will be based on the branches in the following repository that your project is connected with:' : 'Your database preview branches will be based on the branches in the Git repository that your project is connected with.'}
{githubConnection ? ( <>