"use client"; import { Suspense } from "react"; import { useGitHubApp } from "@/hooks/useGitHubApp"; import { GitHubAppProvider } from "@/providers/GitHubApp"; import { InstallationSelector } from "@/components/github/installation-selector"; import { GithubPageLoading } from "@/components/github/github-page-loading"; function GitHubPageContent() { const { repositories, isLoading, error, isInstalled, refreshRepositories } = useGitHubApp(); const handleInstall = async () => { window.location.href = "/api/github/installation"; }; return (

GitHub Repository Access

{isInstalled && (
)}
{error && (
{error}
)} {!isInstalled ? (

Install GitHub App

To access your GitHub repositories, you need to install our GitHub App and grant it access to the repositories you want to use.

) : (

Your Repositories

{repositories.length === 0 && !isLoading ? (

No repositories found. Make sure you've granted access to at least one repository for the selected organization.

) : isLoading ? (

Loading repositories...

) : ( )}
)}

Manage GitHub App

You can manage your GitHub App installation, including adding or removing repositories, through GitHub.

Manage on GitHub
); } export default function GitHubPage() { return ( }> ); }