1- import { Card , CardContent , CardDescription , CardFooter , CardHeader , CardTitle } from "@/components/ui/card" ;
2- import { Button } from "@/components/ui/button" ;
3- import { GitFork , Star , Users , ExternalLink } from "lucide-react" ;
4- import { useRouter } from "next/navigation" ;
1+ import { Card , CardContent , CardFooter , CardHeader , CardTitle } from '@/components/ui/card' ;
2+ import { Button } from '@/components/ui/button' ;
3+ import { Repository } from '@/lib/github-api' ;
4+ import { Star , GitFork , ExternalLink } from 'lucide-react' ;
5+ import { useAuthAwareNavigation , useAuthDebug } from '@/utils/authPersistence' ;
56
6- export function RepositoryCard ( { repo } : { repo : any } ) {
7- const router = useRouter ( ) ;
7+ interface ProjectCardProps {
8+ repo : Repository ;
9+ }
10+
11+ export const RepositoryCard : React . FC < ProjectCardProps > = ( { repo } ) => {
12+ const router = useAuthAwareNavigation ( ) ;
13+ const { logAuthState } = useAuthDebug ( ) ;
814
915 const handleOpenInBeetle = ( ) => {
16+ logAuthState ( 'RepositoryCard:BeforeNavigation' ) ;
1017 const repoData = JSON . stringify ( repo ) ;
1118 const encodedRepo = encodeURIComponent ( repoData ) ;
1219 router . push ( `/contribution?repo=${ encodedRepo } ` ) ;
1320 } ;
1421
1522 return (
16- < Card className = "flex flex-col" >
23+ < Card className = "bg-black shadow-lg rounded-lg flex flex-col h-full hover:shadow-orange-500/20 transition-shadow duration-300 " >
1724 < CardHeader >
18- < CardTitle > { repo . name } </ CardTitle >
19- < CardDescription > { repo . description } </ CardDescription >
25+ < CardTitle className = "text-xl font-bold text-orange-500" > { repo . name } </ CardTitle >
2026 </ CardHeader >
2127 < CardContent className = "flex-grow" >
22- < div className = "flex items-center space-x-4 text-sm text-muted-foreground" >
23- < div className = "flex items-center" >
24- < Star className = "mr-1 h-3 w-3" />
25- { repo . stargazers_count }
26- </ div >
28+ < p className = "text-sm text-gray-400" > { repo . description } </ p >
29+ </ CardContent >
30+ < CardFooter className = "flex justify-between items-center mt-auto pt-4 border-t border-gray-800" >
31+ < div className = "flex items-center space-x-4 text-gray-400" >
2732 < div className = "flex items-center" >
28- < GitFork className = "mr-1 h-3 w-3 " />
29- { repo . forks_count }
33+ < Star className = "h-4 w-4 mr-1 " />
34+ < span > { repo . stargazers_count } </ span >
3035 </ div >
3136 < div className = "flex items-center" >
32- < Users className = "mr-1 h-3 w-3 " />
33- { repo . watchers_count }
37+ < GitFork className = "h-4 w-4 mr-1 " />
38+ < span > { repo . forks_count } </ span >
3439 </ div >
3540 </ div >
36- </ CardContent >
37- < CardFooter className = "flex justify-between items-center space-x-2" >
38- < Button
39- variant = "outline"
40- size = "sm"
41- onClick = { ( ) => window . open ( repo . html_url , '_blank' ) }
42- className = "flex items-center space-x-1"
43- >
44- < ExternalLink className = "h-3 w-3" />
45- < span > GitHub</ span >
46- </ Button >
47- < Button
48- size = "sm"
49- onClick = { handleOpenInBeetle }
50- >
51- Open in GitMesh
52- </ Button >
41+ < div className = "flex items-center space-x-2" >
42+ < Button variant = "outline" size = "sm" onClick = { ( ) => window . open ( repo . html_url , '_blank' ) } className = "bg-black text-white hover:bg-gray-700 border-gray-700" >
43+ < ExternalLink className = "h-4 w-4" />
44+ </ Button >
45+ < Button
46+ size = "sm"
47+ onClick = { handleOpenInBeetle }
48+ className = "bg-orange-500 text-black hover:bg-orange-600"
49+ data-testid = "open-in-gitmesh"
50+ >
51+ Open in GitMesh
52+ </ Button >
53+ </ div >
5354 </ CardFooter >
5455 </ Card >
5556 ) ;
56- }
57+ } ;
0 commit comments