{"version":3,"file":"Share_Component.ClIIBcX3.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/I2Czc5Qyb0jvvXBdaZOX/K1PC63PgODYCTGc3TZVH/Share_Component.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Share_Component(props){const{children,socialMedia,message}=props;const[socialLink,setSocialLink]=useState(\"\");useEffect(()=>{var _window_location,_window;const pageTitle=document.title;const currentLink=(_window=window)===null||_window===void 0?void 0:(_window_location=_window.location)===null||_window_location===void 0?void 0:_window_location.href;switch(socialMedia){case\"twitter\":setSocialLink(`https://twitter.com/intent/tweet?text=${encodeURIComponent(message)}&url=${encodeURIComponent(currentLink)}`);break;case\"facebook\":setSocialLink(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(currentLink)}&quote=${encodeURIComponent(message)}`);break;case\"linkedin\":setSocialLink(`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(currentLink)}&title=${encodeURIComponent(message)}`);break;case\"whatsapp\":setSocialLink(`https://api.whatsapp.com/send?text=${encodeURIComponent(message)}%20${encodeURIComponent(currentLink)}`);break;case\"email\":setSocialLink(`mailto:?subject=${encodeURIComponent(pageTitle)}&body=${encodeURIComponent(message+\" \"+currentLink)}`);break;case\"reddit\":setSocialLink(`https://www.reddit.com/submit?url=${encodeURIComponent(currentLink)}&title=${encodeURIComponent(message)}`);break;default:setSocialLink(\"\");}},[socialMedia,message]);const handleClick=e=>{if(socialMedia===\"copy\"){var _window_location,_window;e.preventDefault();navigator.clipboard.writeText((_window=window)===null||_window===void 0?void 0:(_window_location=_window.location)===null||_window_location===void 0?void 0:_window_location.href);alert(\"Link copied to clipboard!\");}};return /*#__PURE__*/_jsx(\"a\",{href:socialLink,target:\"_blank\",rel:\"noopener noreferrer\",onClick:handleClick,style:{...props.style},children:children});}addPropertyControls(Share_Component,{children:{type:ControlType.ComponentInstance},socialMedia:{title:\"Social Media\",type:ControlType.Enum,defaultValue:\"facebook\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",options:[\"facebook\",\"twitter\",\"linkedin\",\"whatsapp\",\"email\",\"reddit\",\"copy\"],optionTitles:[\"Facebook\",\"Twitter\",\"Linkedin\",\"WhatsApp\",\"Email\",\"Reddit\",\"Copy\"]},message:{type:ControlType.String,defaultValue:\"Check out this blog post:\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Share_Component\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Share_Component.map"],"mappings":"uMAKG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,WAAS,EAAW,CAAC,EAAW,GAAeA,EAAS,GAAG,CAAm+C,OAAl+C,MAAc,CAA8B,IAAM,EAAU,SAAS,MAAY,EAAqB,GAAkE,UAAoE,KAAK,OAAO,EAAP,CAAoB,IAAI,UAAU,EAAc,yCAAyC,mBAAmB,EAAQ,CAAC,OAAO,mBAAmB,EAAY,GAAG,CAAC,MAAM,IAAI,WAAW,EAAc,gDAAgD,mBAAmB,EAAY,CAAC,SAAS,mBAAmB,EAAQ,GAAG,CAAC,MAAM,IAAI,WAAW,EAAc,uDAAuD,mBAAmB,EAAY,CAAC,SAAS,mBAAmB,EAAQ,GAAG,CAAC,MAAM,IAAI,WAAW,EAAc,sCAAsC,mBAAmB,EAAQ,CAAC,KAAK,mBAAmB,EAAY,GAAG,CAAC,MAAM,IAAI,QAAQ,EAAc,mBAAmB,mBAAmB,EAAU,CAAC,QAAQ,mBAAmB,EAAQ,IAAI,EAAY,GAAG,CAAC,MAAM,IAAI,SAAS,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