MCPcopy Create free account
hub / github.com/CodebuffAI/codebuff / RepositoriesPage

Function RepositoriesPage

web/src/app/orgs/[slug]/repositories/page.tsx:12–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10import { useOrganizationData } from '@/hooks/use-organization-data'
11
12export default function RepositoriesPage() {
13 const { data: session, status } = useSession()
14 const params = useParams() ?? {}
15 const router = useRouter()
16 const orgSlug = (params.slug as string) ?? ''
17
18 // Use the custom hook for organization data
19 const { organization, isLoading, error } = useOrganizationData(orgSlug)
20
21 if (status === 'loading' || isLoading) {
22 return (
23 <div className="container mx-auto py-6 px-4">
24 <div className="max-w-6xl mx-auto">
25 <div className="animate-pulse">
26 <div className="h-8 bg-gray-200 rounded w-64 mb-6"></div>
27 <div className="space-y-6">
28 <div className="h-48 bg-gray-200 rounded"></div>
29 </div>
30 </div>
31 </div>
32 </div>
33 )
34 }
35
36 if (!session) {
37 return (
38 <div className="container mx-auto py-6 px-4">
39 <div className="max-w-md mx-auto">
40 <div className="text-center">
41 <h1 className="text-2xl font-bold mb-4">Sign in Required</h1>
42 <p className="mb-4">
43 Please sign in to manage this organization's repositories.
44 </p>
45 <Link href="/login">
46 <Button>Sign In</Button>
47 </Link>
48 </div>
49 </div>
50 </div>
51 )
52 }
53
54 if (error || !organization) {
55 return (
56 <div className="container mx-auto py-6 px-4">
57 <div className="max-w-md mx-auto">
58 <div className="text-center">
59 <h1 className="text-2xl font-bold mb-4">Error</h1>
60 <p className="mb-4">{error || 'Organization not found'}</p>
61 <div className="flex gap-2 justify-center">
62 <Button onClick={() => router.back()} variant="outline">
63 Go Back
64 </Button>
65 <Button onClick={() => window.location.reload()}>
66 Try Again
67 </Button>
68 </div>
69 </div>

Callers

nothing calls this directly

Calls 1

useOrganizationDataFunction · 0.90

Tested by

no test coverage detected