import{j as e}from"./vendor-radix-DNp60FuA.js";import{B as a,a6 as n}from"./index-DyYtMrmN.js";import{I as x}from"./input-DahjePUl.js";import{L as d}from"./label-BhhyEfcr.js";import{c as w,d as u,e as k,f}from"./index-2qSVHfop.js";import{S as j}from"./share-2-C3OUaSth.js";import{C}from"./copy-CQx-7NlT.js";const F=({shareUrl:s,blogTitle:o,className:i,showSocialButtons:r=!0})=>{const c=async()=>{try{await navigator.clipboard.writeText(s),n.success("Share link copied!",{description:"The article link has been copied to your clipboard"})}catch{n.error("Failed to copy",{description:"Please try again"})}},l=()=>{const t=encodeURIComponent(`Check out this insightful article: ${o}`);window.open(`https://wa.me/?text=${t}%20${encodeURIComponent(s)}`,"_blank")},m=()=>{window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(s)}`,"_blank")},p=()=>{const t=encodeURIComponent(`${o}`);window.open(`https://twitter.com/intent/tweet?text=${t}&url=${encodeURIComponent(s)}`,"_blank")},h=()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(s)}`,"_blank")};return e.jsxs("div",{className:i,children:[e.jsxs(d,{className:"flex items-center gap-2 mb-2",children:[e.jsx(j,{className:"h-4 w-4"}),"Share This Article"]}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(x,{value:s,readOnly:!0,className:"font-mono text-sm",onClick:t=>t.currentTarget.select()}),e.jsx(a,{onClick:c,size:"sm",variant:"outline",className:"shrink-0",children:e.jsx(C,{className:"h-4 w-4"})})]}),r&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(a,{onClick:l,variant:"outline",size:"sm",className:"flex-1 min-w-[120px]",children:[e.jsx(w,{className:"h-4 w-4 mr-2"}),"WhatsApp"]}),e.jsxs(a,{onClick:m,variant:"outline",size:"sm",className:"flex-1 min-w-[120px]",children:[e.jsx(u,{className:"h-4 w-4 mr-2"}),"LinkedIn"]}),e.jsxs(a,{onClick:p,variant:"outline",size:"sm",className:"flex-1 min-w-[120px]",children:[e.jsx(k,{className:"h-4 w-4 mr-2"}),"Twitter"]}),e.jsxs(a,{onClick:h,variant:"outline",size:"sm",className:"flex-1 min-w-[120px]",children:[e.jsx(f,{className:"h-4 w-4 mr-2"}),"Facebook"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Share this article with your network"})]})};export{F as B};