| 1 | "use client"; |
| 2 | |
| 3 | import { Plus, Tag |
| 4 | import Link from "next/link |
| 5 | import { usePathname } |
| 6 | |
| 7 | import { TabLink } |
| 8 | import { Button } |
| 9 | |
| 10 | export function ReleasesNav({ |
| 11 | username, |
| 12 | repo, |
| 13 | canWrite, |
| 14 | }: { |
| 15 | username: string |
| 16 | repo: string |
| 17 | canWrite: boolean |
| 18 | }) { |
| 19 | const pathname = |
| 20 | const base = |
| 21 | // a single release and the release forms have headers of their own |
| 22 | const active = |
| 23 | ? pathname.slice( |
| 24 | : null; |
| 25 | if (!active) |
| 26 | |
| 27 | return ( |
| 28 | <div className="flex flex-wrap items-center gap-2 border-b |
| 29 | <nav className="-mb-px flex gap-1 |
| 30 | <TabLink href={ |
| 31 | Releases |
| 32 | </TabLink> |
| 33 | <TabLink href={ |
| 34 | <Tag className=" |
| 35 | Tags |
| 36 | </TabLink> |
| 37 | </nav> |
| 38 | {canWrite && ( |
| 39 | <Button size=" |
| 40 | <Link href={ |
| 41 | <Plus data-icon=" |
| 42 | Draft a new release |
| 43 | </Link> |
| 44 | </Button> |
| 45 | )} |
| 46 | </div> |
| 47 | ); |
| 48 | } |