diff --git a/src/components/RepositoryCard.tsx b/src/components/RepositoryCard.tsx index 3b20d838..27a86a3c 100644 --- a/src/components/RepositoryCard.tsx +++ b/src/components/RepositoryCard.tsx @@ -1,18 +1,12 @@ -import React, { useState } from 'react'; +import React from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; -import { - GitBranch, - ExternalLink, - Copy, - Check, -} from 'lucide-react'; +import { GitBranch } from 'lucide-react'; import type { Repository } from '@/hooks/useUserRepositories'; import { useAuthor } from '@/hooks/useAuthor'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; import { genUserName } from '@/lib/genUserName'; -import { useToast } from '@/hooks/useToast'; import { useNavigate } from 'react-router-dom'; interface RepositoryCardProps { @@ -21,36 +15,13 @@ interface RepositoryCardProps { export function RepositoryCard({ repo }: RepositoryCardProps) { const { data: authorData } = useAuthor(repo.pubkey); - const { toast } = useToast(); const navigate = useNavigate(); - const [copiedUrl, setCopiedUrl] = useState(null); const displayName = authorData?.metadata?.name || genUserName(repo.pubkey); const profileImage = authorData?.metadata?.picture; // Get the first clone URL (prefer HTTPS) const primaryCloneUrl = repo.cloneUrls.find(url => url.startsWith('https://')) || repo.cloneUrls[0]; - const webUrl = repo.webUrls[0]; - - const handleCopyUrl = async (url: string, e: React.MouseEvent) => { - e.stopPropagation(); - try { - await navigator.clipboard.writeText(url); - setCopiedUrl(url); - toast({ - title: 'Copied to clipboard', - description: 'Repository URL copied successfully', - }); - setTimeout(() => setCopiedUrl(null), 2000); - } catch (error) { - console.error('Failed to copy URL:', error); - toast({ - title: 'Failed to copy', - description: 'Could not copy URL to clipboard', - variant: 'destructive', - }); - } - }; const handleClone = () => { if (primaryCloneUrl) { @@ -113,42 +84,15 @@ export function RepositoryCard({ repo }: RepositoryCardProps) { )} {/* Actions */} -
+
{primaryCloneUrl && ( - <> - - - - )} - {webUrl && ( )}