)
}
export const GitHubSection = () => {
const { ref: projectRef } = useParams()
const { data: organization } = useSelectedOrganizationQuery()
const { can: canReadGitHubConnection, isLoading: isLoadingPermissions } =
useAsyncCheckPermissions(PermissionAction.READ, 'integrations.github_connections')
const isProPlanAndUp = organization?.plan?.id !== 'free'
const promptProPlanUpgrade = IS_PLATFORM && !isProPlanAndUp
const { data: gitHubAuthorization } = useGitHubAuthorizationQuery()
const { data: connections } = useGitHubConnectionsQuery(
{ organizationId: organization?.id },
{ enabled: !!projectRef && !!organization?.id }
)
const existingConnection = useMemo(
() => connections?.find((c) => c.project.ref === projectRef),
[connections, projectRef]
)
const GitHubTitle = `GitHub Integration`
return (
Connect any of your GitHub repositories to a project.
Connecting to GitHub allows you to sync preview branches with a chosen GitHub branch, keep your production branch in sync, and automatically create preview branches for every pull request.
{promptProPlanUpgrade && (