import { notFound } from "next/navigation"; import { db } from "@/db"; import { users } from "@/db/schema"; import { eq } from "drizzle-orm"; import { getUserRepositoriesWithStars } from "@/actions/repositories"; import { RepoList } from "@/components/repo-list"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { CalendarDays, GitBranch, MapPin, Link as LinkIcon } from "lucide-react"; import { format } from "date-fns"; import Link from "next/link"; import { GithubIcon, XIcon, LinkedInIcon } from "@/components/icons"; export default async function ProfilePage({ params }: { params: Promise<{ username: string }> }) { const { username } = await params; const user = await db.query.users.findFirst({ where: eq(users.username, username), }); if (!user) { notFound(); } const repos = await getUserRepositoriesWithStars(username); return (

Repositories

({repos.length})
{repos.length === 0 ? (

No repositories yet

{user.name} hasn't created any public repositories.

) : ( )}
); }