"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Check, Copy, ChevronDown } from "lucide-react"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; import { getPublicServerUrl } from "@/lib/utils"; export function CloneUrl({ username, repoName }: { username: string; repoName: string }) { const [copied, setCopied] = useState(false); const [protocol, setProtocol] = useState<"https" | "ssh">("https"); const baseUrl = getPublicServerUrl(); const httpsUrl = `${baseUrl}/api/git/${username}/${repoName}.git`; const sshUrl = `git@gitbruv.local:${username}/${repoName}.git`; const url = protocol === "https" ? httpsUrl : sshUrl; async function copyToClipboard() { await navigator.clipboard.writeText(url); setCopied(true); setTimeout(() => setCopied(false), 2000); } return (