chore: remove unused code and visitor tracking
This commit is contained in:
+2
-22
@@ -6,11 +6,8 @@ import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { Finger_Paint } from "next/font/google";
|
||||
import { getFollowerCounts } from "@/lib/followers";
|
||||
import { headers } from "next/headers";
|
||||
import { Share2, Trophy, Users } from "lucide-react";
|
||||
import { Kbd } from "@/components/ui/kbd";
|
||||
import { Share2, Trophy } from "lucide-react";
|
||||
import Background from "@/public/background/space.webp";
|
||||
import { trackUniqueVisitor } from "@/lib/visitor/unique-visitors";
|
||||
import {
|
||||
formatCount,
|
||||
getCountForLink,
|
||||
@@ -106,16 +103,7 @@ function LinkList({
|
||||
}
|
||||
|
||||
export default async function Home() {
|
||||
const visitorCountPromise = headers()
|
||||
.then(trackUniqueVisitor)
|
||||
.catch((error) => {
|
||||
console.error("Failed to track visitor:", error);
|
||||
return 0;
|
||||
});
|
||||
const [{ counts }, visitorCount] = await Promise.all([
|
||||
getFollowerCounts(),
|
||||
visitorCountPromise,
|
||||
]);
|
||||
const { counts } = await getFollowerCounts();
|
||||
|
||||
// Use configured profile data.
|
||||
const profileName = config.profile.name;
|
||||
@@ -166,14 +154,6 @@ export default async function Home() {
|
||||
<h1 className={`${fingerPaint.className} text-2xl`}>
|
||||
{profileName}
|
||||
</h1>
|
||||
{visitorCount > 0 && (
|
||||
<div className="mt-3 flex justify-center">
|
||||
<Kbd>
|
||||
<Users className="size-3.5" />
|
||||
<span>{visitorCount} Unique Visitors</span>
|
||||
</Kbd>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user