text: import Link from '@/components/Link'
  import PageTitle from '@/components/PageTitle'
  import { PageSEO } from '@/components/SEO'
  import Tag from '@/components/Tag'
  import siteMetadata from '@/data/siteMetadata'
  import { getAllTags } from '@/lib/tags'
  import kebabCase from '@/lib/utils/kebabCase'
  
  export async function getStaticProps() {
    const tags = await getAllTags('projects')
  
    return { props: { tags } }
  }
  
  export default function Tags({ tags }) {
    const sortedTags = Object.keys(tags).sort((a, b) => tags[b] - tags[a])
    return (
      <>
        <PageSEO title={`Tags - ${siteMetadata.author}`} description="Project tags" />
        <div className="flex flex-row justify-center items-center">
          <div className="pt-6 pb-6">
            <PageTitle>Tags</PageTitle>
          </div>
          <div>
            {Object.keys(tags).length === 0 && 'No tags found.'}
            {sortedTags.map((t) => {
              return (
                <div key={t} className="ml-8 mt-2">
                  <Tag text={t} />
                  <Link
                    href={`/tags/${kebabCase(t)}`}
                    className="-ml-2 text-sm font-semibold text-black uppercase dark:text-white"
                  >
                    {` (${tags[t]})`}
                  </Link>
                </div>
              )
            })}
          </div>
        </div>
      </>
    )
  }
  