{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/QRp7AyrN1gzcaKo1J5g0/R2U7HEx9pz26joJOtqGe/CustomShareButton.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CustomShareButton(props){var _props_iconImage;const[isHovered,setIsHovered]=useState(false);const handleMouseEnter=()=>{setIsHovered(true);};const handleMouseLeave=()=>{setIsHovered(false);};// TO DO: handler all platform in a dropdown\n// Pick URL from browser\nconst shareOnX=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const xShareUrl=`https://twitter.com/intent/tweet?text=${title}%0D%0D&url=${url}`;window.open(xShareUrl,\"_blank\");};const shareOnLinkedIn=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const linkedinShareUrl=`https://www.linkedin.com/shareArticle?mini=true&url=${url}%2F&title=${title}&summary=`;window.open(linkedinShareUrl,\"_blank\");};const shareOnFacebook=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const facebookShareUrl=`https://www.facebook.com/sharer/sharer.php?u=${url}`;window.open(facebookShareUrl,\"_blank\");};const shareOnPinterest=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const PiShareUrl=`https://www.pinterest.com/pin/create/button/?&text=${title}&url=${url}&description=${title}`;window.open(PiShareUrl,\"_blank\");};const shareOnWhatsapp=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const whShareUrl=`https://api.whatsapp.com/send?text=${title}%20${url}`;window.open(whShareUrl,\"_blank\");};const shareOnTelegram=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const telegramShareUrl=`https://t.me/share/url?url=${url}&text=${title}`;window.open(telegramShareUrl,\"_blank\");};const shareOnReddit=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const redditShareUrl=`https://reddit.com/submit?url=${url}&title=${title}`;window.open(redditShareUrl,\"_blank\");};const shareOnHackerNews=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const hackernewsShareUrl=`https://news.ycombinator.com/submitlink?u=${url}&t=${title}`;window.open(hackernewsShareUrl,\"_blank\");};const shareOnEmail=()=>{const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);const emailShareUrl=`mailto:?subject=${title}&body=${url}`;window.open(emailShareUrl,\"_blank\");};const shareOnClipboard=()=>{const url=window.location.href;navigator.clipboard.writeText(url);};const handleShare=()=>{switch(props.platform){case\"X\":shareOnX();break;case\"Facebook\":shareOnFacebook();break;case\"LinkedIn\":shareOnLinkedIn();break;case\"Pinterest\":shareOnPinterest();break;case\"Whatsapp\":shareOnWhatsapp();break;case\"Telegram\":shareOnTelegram();break;case\"Reddit\":shareOnReddit();break;case\"Hacker News\":shareOnHackerNews();break;case\"Email\":shareOnEmail();break;case\"Clipboard\":shareOnClipboard();break;default:console.log(\"Unsupported platform\");}};return /*#__PURE__*/_jsx(\"button\",{onClick:handleShare,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:{width:\"auto\",height:\"auto\",backgroundColor:props.backgroundcolor,borderRadius:props.radius,padding:props.padding,borderColor:props.borderproperties.color,borderWidth:props.borderproperties.width,borderStyle:props.borderproperties.style,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",opacity:isHovered?.8:1},children:/*#__PURE__*/_jsx(\"img\",{src:((_props_iconImage=props.iconImage)===null||_props_iconImage===void 0?void 0:_props_iconImage.src)||\"https://img.icons8.com/?size=100&id=fJp7hepMryiw&format=png&color=ffffff\",alt:props.iconAlt,width:props.iconWidth})},props.iconAlt);}CustomShareButton.defaultProps={iconWidth:24,platform:\"Twitter\",backgroundColor:\"#212121\",borderRadius:16,padding:16,borderColor:\"#222222\",borderWidth:0,borderStyle:\"solid\"};addPropertyControls(CustomShareButton,{platform:{type:ControlType.Enum,options:[\"X\",\"Facebook\",\"LinkedIn\",\"Pinterest\",\"Whatsapp\",\"Telegram\",\"Reddit\",\"Hacker News\",\"Email\",\"Clipboard\"],defaultValue:\"X\"},iconImage:{type:ControlType.ResponsiveImage},iconAlt:{type:ControlType.String,defaultValue:\"X social share icon\"},iconWidth:{type:ControlType.Number,title:\"Width\",defaultValue:\"24\"},backgroundcolor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#212121\"},radius:{type:ControlType.FusedNumber,title:\"Radius\",defaultValue:16,toggleKey:\"isMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeft\",\"topRight\",\"bottomRight\",\"bottomLeft\"],valueLabels:[\"NW\",\"NE\",\"SE\",\"SW\"],min:0},padding:{type:ControlType.FusedNumber,title:\"Padding\",defaultValue:16,toggleKey:\"isMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeft\",\"topRight\",\"bottomRight\",\"bottomLeft\"],valueLabels:[\"NW\",\"NE\",\"SE\",\"SW\"],min:0},borderproperties:{type:ControlType.Object,title:\"Border\",controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#222222\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:0},style:{type:ControlType.Enum,title:\"Style\",options:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"],defaultValue:\"Solid\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomShareButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomShareButton.map"],
  "mappings": "gJAQkB,SAARA,EAAmCC,EAAM,CAAC,IAAI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SAAS,EAAE,MAAM,CAAC,KAAKA,EAAY,OAAO,MAAM,QAAQ,aAAa,CAAC,EAAE,MAAM,CAAC,KAAKA,EAAY,KAAK,MAAM,QAAQ,QAAQ,CAAC,QAAQ,SAAS,SAAS,QAAQ,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,CAAC",
  "names": ["CustomShareButton", "props", "_props_iconImage", "isHovered", "setIsHovered", "ye", "handleMouseEnter", "handleMouseLeave", "shareOnX", "url", "window", "xShareUrl", "shareOnLinkedIn", "title", "linkedinShareUrl", "shareOnFacebook", "facebookShareUrl", "shareOnPinterest", "PiShareUrl", "shareOnWhatsapp", "whShareUrl", "shareOnTelegram", "telegramShareUrl", "shareOnReddit", "redditShareUrl", "shareOnHackerNews", "hackernewsShareUrl", "shareOnEmail", "emailShareUrl", "shareOnClipboard", "navigator", "p", "addPropertyControls", "ControlType"]
}
