"use client"; import { useGitHubApp } from "@/hooks/useGitHubApp"; import { InstallAppButton } from "./install-app-button"; import { Button } from "@/components/ui/button"; import { RefreshCw } from "lucide-react"; interface RepositoryListProps { className?: string; } export function RepositoryList({ className = "" }: RepositoryListProps) { const { isInstalled, isLoading, error, repositories, refreshRepositories } = useGitHubApp(); if (isLoading) { return (
{[1, 2, 3].map((i) => (
))}
); } if (error) { return (

{error}

); } if (!isInstalled) { return (

GitHub App Not Installed

You need to install our GitHub App to grant access to your repositories.

Install GitHub App
); } return (

Your GitHub Repositories

{repositories.length === 0 ? (

No repositories found. You may need to grant access to repositories in GitHub.

Manage GitHub App permissions
) : (
{repositories.map((repo) => (

{repo.full_name}

{repo.description || "No description"}

{repo.private ? "Private" : "Public"} Default branch: {repo.default_branch}
))}
)}

Need to add or remove repositories?{" "} Manage on GitHub

); }