1
1
import { FaStar } from "react-icons/fa" ;
2
2
3
3
const RepoCard = ( { repo } ) => {
4
- const { name, html_url, stargazers_count, language, owner, description } = repo ;
4
+ const { name, html_url, stargazers_count, language, owner, description, forks_count , open_issues , topics } = repo ;
5
5
return (
6
6
< a href = { html_url } target = "_blank" rel = "noopener noreferrer"
7
- className = "bg-slate-900 border flex flex-col justify-between rounded-lg border-gray-700 p-5 shadow hover:bg-gray-700 delay-100 h-full duration-200 w-full" >
8
- < div >
7
+ className = "bg-slate-900/60 border flex flex-col justify-between rounded-lg border-gray-700 p-5 shadow hover:bg-gray-700 delay-100 h-full duration-200 w-full" >
8
+ < div >
9
9
< div className = "flex flex-row" >
10
10
{ /*<img src={owner?.avatar_url} className="rounded h-40 w-40"/>*/ }
11
11
< p >
@@ -17,13 +17,54 @@ const RepoCard = ({ repo }) => {
17
17
{ description }
18
18
</ p >
19
19
</ div >
20
- < div className = "flex justify-between mt-4" >
20
+ < div className = "flex flex-wrap justify-start mt-2" >
21
+ { topics ?. map ( ( topic , index ) => (
22
+ < div key = { index } className = "flex m-1 text-xs font-medium bg-blue-500/20 text-blue-400 rounded-xl px-2 py-1" > { topic } </ div >
23
+ ) ) }
24
+ </ div >
25
+
26
+ < div className = "flex justify-start mt-4" >
21
27
< span className = "text-xs text-gray-500" > { language } </ span >
22
28
< div className = "flex flex-row justify-between" >
23
- < div className = "flex flex-row text-gray-500 hover:text-white" >
29
+ < div className = "flex flex-row text-gray-500 hover:text-white ml-3 " >
24
30
< FaStar className = "h-4 w-4" />
25
31
< span className = "text-xs ml-1" > { stargazers_count } </ span >
26
32
</ div >
33
+ < div className = "flex flex-row text-gray-500 hover:text-white ml-3" >
34
+ < svg
35
+ aria-hidden = "true"
36
+ height = "16"
37
+ viewBox = "0 0 16 16"
38
+ version = "1.1"
39
+ width = "16"
40
+ data-view-component = "true"
41
+ class = "octicon octicon-repo-forked mr-1 fill-current" >
42
+ < path
43
+ fill-rule = "evenodd"
44
+ d = "M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z" >
45
+ </ path >
46
+ </ svg >
47
+ < span className = "text-xs ml-1" > { forks_count } </ span >
48
+ </ div >
49
+
50
+ < div className = "flex flex-row text-gray-500 hover:text-white ml-3" >
51
+ < svg
52
+ aria-hidden = "true"
53
+ height = "16"
54
+ viewBox = "0 0 16 16"
55
+ version = "1.1"
56
+ width = "16"
57
+ data-view-component = "true"
58
+ class = "octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline fill-current" >
59
+ < path d = "M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z" >
60
+ </ path >
61
+ < path
62
+ fill-rule = "evenodd"
63
+ d = "M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z" >
64
+ </ path >
65
+ </ svg >
66
+ < span className = "text-xs ml-1" > { open_issues } </ span >
67
+ </ div >
27
68
</ div >
28
69
</ div >
29
70
</ a >
0 commit comments