---
interface Props {
  path: string
  label?: string
}

const { path, label = path } = Astro.props
const repoPath = path.replace(/^\/+/, '')
const href = `https://github.com/jackin-project/jackin/blob/main/${encodeURI(repoPath)}`
---

<a href={href} target="_blank" rel="noopener noreferrer"><code>{label}</code></a>
