import { CheckCircle, Copy, Facebook, Linkedin, Twitter } from 'lucide-react'; import { useCopyText } from '../../hooks/use-copy-text'; import { cn } from '../../lib/classname'; import type { AllowedRoadmapVisibility } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal'; type ShareSuccessProps = { roadmapId: string; onClose: () => void; visibility: AllowedRoadmapVisibility; description?: string; isSharingWithOthers?: boolean; }; export function ShareSuccess(props: ShareSuccessProps) { const { roadmapId, onClose, description, visibility, isSharingWithOthers = false, } = props; const baseUrl = import.meta.env.DEV ? 'http://localhost:3000' : 'https://roadmap.sh'; const shareLink = `${baseUrl}/r?id=${roadmapId}`; const { copyText, isCopied } = useCopyText(); const socialShareLinks = [ { title: 'Twitter', href: `https://twitter.com/intent/tweet?text=${description}&url=${shareLink}`, icon: Twitter, }, { title: 'Facebook', href: `https://www.facebook.com/sharer/sharer.php?quote=${description}&u=${shareLink}`, icon: Facebook, }, { title: 'Linkedin', href: `https://www.linkedin.com/sharing/share-offsite/?url=${shareLink}`, icon: Linkedin, }, ]; return (
You can share the above link with anyone
) : (You can share the above link with anyone who has access
)} {visibility === 'public' && ( <>