|
| 1 | +import Link from "next/link"; |
1 | 2 | import { forwardRef, type HTMLAttributes } from "react"; |
2 | 3 | import { cx } from "^/lib/cva"; |
3 | 4 |
|
4 | 5 | interface FooterProps extends HTMLAttributes<HTMLDivElement> {} |
5 | 6 |
|
| 7 | +const popularPackages = [ |
| 8 | + "react", |
| 9 | + "next", |
| 10 | + "vue", |
| 11 | + "typescript", |
| 12 | + "express", |
| 13 | + "lodash", |
| 14 | + "axios", |
| 15 | +]; |
| 16 | + |
6 | 17 | const Footer = forwardRef<HTMLDivElement, FooterProps>( |
7 | 18 | ({ className, ...props }, ref) => ( |
8 | 19 | <footer |
9 | | - className={cx("flex contain-content", className)} |
| 20 | + className={cx( |
| 21 | + "flex flex-col gap-6 border-t border-border py-8", |
| 22 | + className, |
| 23 | + )} |
10 | 24 | {...props} |
11 | 25 | ref={ref} |
12 | | - /> |
| 26 | + > |
| 27 | + <div className="mx-auto w-full max-w-7xl px-4"> |
| 28 | + {/* Popular Packages Section */} |
| 29 | + <div className="mb-6"> |
| 30 | + <h3 className="mb-3 text-sm font-semibold uppercase tracking-wider text-muted-foreground"> |
| 31 | + Popular Packages |
| 32 | + </h3> |
| 33 | + <div className="flex flex-wrap gap-3"> |
| 34 | + {popularPackages.map((pkg) => ( |
| 35 | + <Link |
| 36 | + key={pkg} |
| 37 | + href={`/${pkg}`} |
| 38 | + className="rounded-md border border-border bg-card px-3 py-1.5 text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground" |
| 39 | + > |
| 40 | + {pkg} |
| 41 | + </Link> |
| 42 | + ))} |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + |
| 46 | + {/* Footer Links */} |
| 47 | + <div className="flex flex-col gap-4 border-t border-border pt-6 sm:flex-row sm:items-center sm:justify-between"> |
| 48 | + <div className="flex flex-wrap gap-4 text-sm text-muted-foreground"> |
| 49 | + <Link |
| 50 | + href="/-/about" |
| 51 | + className="hover:text-foreground hover:underline" |
| 52 | + > |
| 53 | + About |
| 54 | + </Link> |
| 55 | + <Link |
| 56 | + href="/-/about/api" |
| 57 | + className="hover:text-foreground hover:underline" |
| 58 | + > |
| 59 | + API |
| 60 | + </Link> |
| 61 | + <Link |
| 62 | + href="/-/about/source-trust" |
| 63 | + className="hover:text-foreground hover:underline" |
| 64 | + > |
| 65 | + Source Trust |
| 66 | + </Link> |
| 67 | + <a |
| 68 | + href="https://github.com/oBusk/npm-diff.app" |
| 69 | + target="_blank" |
| 70 | + rel="noopener noreferrer" |
| 71 | + className="hover:text-foreground hover:underline" |
| 72 | + > |
| 73 | + GitHub |
| 74 | + </a> |
| 75 | + </div> |
| 76 | + <div className="text-sm text-muted-foreground"> |
| 77 | + © 2026 npm-diff.app |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + </footer> |
13 | 82 | ), |
14 | 83 | ); |
15 | 84 | Footer.displayName = "Footer"; |
|
0 commit comments