import React from 'react'; interface ShareButtonsProps { url: string; title: string; description?: string; } const ShareButtons: React.FC = ({ url, title, description = '' }) => { // Encode parameters for sharing URLs const encodedUrl = encodeURIComponent(url); const encodedTitle = encodeURIComponent(title); const encodedDescription = encodeURIComponent(description); // Generate sharing URLs const facebookUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`; const twitterUrl = `https://twitter.com/intent/tweet?url=${encodedUrl}&text=${encodedTitle}`; const linkedinUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodedUrl}`; const emailUrl = `mailto:?subject=${encodedTitle}&body=${encodedDescription}%0A%0A${encodedUrl}`; return (
Share: {/* Facebook */} {/* Twitter */} {/* LinkedIn */} {/* Email */}
); }; export default ShareButtons;