import { toast } from 'react-toastify' import SocialShareButton from './SocialShareButton' const SocialShareBar = ({ url, title, platforms = ['facebook', 'twitter', 'linkedin', 'xing', 'email'], }: { url: string title: string platforms?: string[] }) => { const copyLink = () => { navigator.clipboard .writeText(url) .then(() => { toast.success('link copied to clipboard') }) .catch((error: never) => { toast.error('Fehler beim Kopieren des Links: ', error) }) } return (
{platforms.map((platform) => ( ))} {platforms.includes('email') && ( copyLink()} title='share link via email' > )} {platforms.includes('clipboard') && (
copyLink()} title='copy Link' >
)}
) } export default SocialShareBar