1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-02-14 21:10:41 +01:00
Matthias Kretschmann 1d74f420be
move to app router (#1284)
* app router migration

* fixes

* move to Next.js metadata handling

* theme switch fixes

* use some server actions

* update tests

* more unit tests

* restore prettier-plugin-sort-imports functionality

* cleanup

* package updates

* basic layout test

* test tweak

* readme updates
2024-02-01 18:59:51 +00:00

48 lines
1.3 KiB
TypeScript

import Repo from '../../types/repo'
import Icon from '../Icon'
import styles from './index.module.css'
export default function Repository({ repo }: { repo: Repo }) {
const { name, full_name, description, html_url, homepage, stargazers_count } =
repo
const isExternal = !full_name.includes('kremalicious')
// for blog & portfolio and if there's no homepage, use github url
// else use homepage field
const repoLink =
name === 'blog' || name === 'portfolio' || !homepage || isExternal
? html_url
: homepage
return (
<div className={styles.repo}>
<h3 className={styles.repoTitle}>
<a href={repoLink}>{isExternal ? full_name : name}</a>
</h3>
<p>{description}</p>
<p className={styles.meta}>
{name === 'portfolio' || name === 'blog'
? null
: !isExternal &&
homepage && (
<a href={homepage}>
<Icon name="Compass" /> More info
</a>
)}
<a href={html_url}>
<Icon name="GitHub" /> GitHub
</a>
<a
aria-label={`${stargazers_count} stars`}
href={`${html_url}/stargazers`}
>
<Icon name="Star" /> {stargazers_count}
</a>
</p>
</div>
)
}