()
| 5 | const fetcher = (url) => fetch(url).then((res)=>res.json()); |
| 6 | |
| 7 | export default function GithubProfile() { |
| 8 | const myGithubRepoProfile = "https://api.github.com/repos/codingforentrepreneurs/jref.io" |
| 9 | const {data, error, isLoading} = useSWR(myGithubRepoProfile, fetcher) |
| 10 | if (error) return "An error happened" |
| 11 | if (isLoading) return "Loading..." |
| 12 | return ( |
| 13 | <div> |
| 14 | <h1>{data.name}</h1> |
| 15 | <p>{data.description}</p> |
| 16 | <strong>👁 {data.subscribers_count}</strong>{" "} |
| 17 | <strong>✨ {data.stargazers_count}</strong>{" "} |
| 18 | <strong>🍴 {data.forks_count}</strong> |
| 19 | </div> |
| 20 | ) |
| 21 | |
| 22 | |
| 23 | } |
nothing calls this directly
no outgoing calls
no test coverage detected