hunk.code_window:   pages: any
     pageCount: number
     pageSWRs: responseInterface<any, any>[]
     isLoadingMore: boolean
     isReachingEnd: boolean
     isEmpty: boolean
  
hunk.labels: keep keep replace keep keep keep
hunk.after_edit:   pageSWRs: responseInterface<Data, Error>[]
  
hunk.file_path: src/types.ts
hunk.type: replace
file: import React from 'react'
  import Link from 'next/link'
  
  import useRequest from '../../libs/useRequest'
  
  export default () => {
    const id =
      typeof window !== 'undefined' ? window.location.pathname.slice(1) : ''
    const { data } = useRequest<{
      forks_count: number
      stargazers_count: number
      watchers: number
    }>({
      url: '/api/data',
      params: { id }
    })
  
    return (
      <div style={{ textAlign: 'center' }}>
        <h1>{id}</h1>
        {data ? (
          <div>
            <p>forks: {data.forks_count}</p>
            <p>stars: {data.stargazers_count}</p>
            <p>watchers: {data.watchers}</p>
          </div>
        ) : (
          'loading...'
        )}
        <br />
        <br />
        <Link href="/">
          <a>Back</a>
        </Link>
      </div>
    )
  }
  