import { notFound } from "next/navigation"; import { getRepoPageData } from "@/actions/repositories"; import { FileTree } from "@/components/file-tree"; import { CodeViewer } from "@/components/code-viewer"; import { CloneUrl } from "@/components/clone-url"; import { StarButton } from "@/components/star-button"; import { BranchSelector } from "@/components/branch-selector"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Lock, Globe, FileCode, Settings, GitCommit, GitBranch } from "lucide-react"; import Link from "next/link"; import { getPublicServerUrl } from "@/lib/utils"; export default async function RepoPage({ params }: { params: Promise<{ username: string; repo: string }> }) { const { username, repo: repoName } = await params; const data = await getRepoPageData(username, repoName); if (!data) { notFound(); } const { repo, files, isEmpty, readmeContent, branches, commitCount, isOwner } = data; return (
{repo.description}
}Get started by cloning or pushing to this repository.
{`echo "# ${repoName}" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin ${cloneUrl}
git push -u origin main`}
{`git remote add origin ${cloneUrl}
git branch -M main
git push -u origin main`}