import{j as e}from"./vendor-radix-DNp60FuA.js";import{B as r,a6 as n}from"./index-Dc36HHPJ.js";import{I as w}from"./input-DnjUB7rL.js";import{L as a}from"./label-C4Jig_0W.js";import{c as x,d as b,e as u,f}from"./index-Cx3TF-Qd.js";import{S as v}from"./share-2-TfCXO6QH.js";import{C as g}from"./copy-CZgMmGrC.js";const F=({shareUrl:t,jobTitle:i,className:s,showSocialButtons:h=!0})=>{const c=async()=>{if(t)try{await navigator.clipboard.writeText(t),n.success("Share link copied!",{description:"The job share link has been copied to your clipboard"})}catch{n.error("Failed to copy",{description:"Please try again"})}},m=()=>{if(!t)return;const o=encodeURIComponent(`Check out this job opportunity: ${i}`);window.open(`https://wa.me/?text=${o}%20${encodeURIComponent(t)}`,"_blank")},p=()=>{t&&window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(t)}`,"_blank")},d=()=>{if(!t)return;const o=encodeURIComponent(`Check out this job opportunity: ${i}`);window.open(`https://twitter.com/intent/tweet?text=${o}&url=${encodeURIComponent(t)}`,"_blank")},l=()=>{t&&window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(t)}`,"_blank")};return t?e.jsxs("div",{className:s,children:[e.jsxs(a,{className:"flex items-center gap-2 mb-2 text-white",children:[e.jsx(v,{className:"h-4 w-4"}),"Share This Job"]}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(w,{value:t,readOnly:!0,className:"font-mono text-sm bg-white/5 border-white/10 text-white placeholder:text-muted-foreground",onClick:o=>o.currentTarget.select()}),e.jsx(r,{onClick:c,size:"sm",variant:"outline",className:"shrink-0 bg-white/5 border-white/10 text-white hover:bg-white/10 hover:text-white",children:e.jsx(g,{className:"h-4 w-4"})})]}),h&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(r,{onClick:m,variant:"outline",size:"sm",className:"flex-1 min-w-[120px] bg-white/5 border-white/10 text-white hover:bg-primary/20 hover:border-primary/50 hover:text-white",children:[e.jsx(x,{className:"h-4 w-4 mr-2"}),"WhatsApp"]}),e.jsxs(r,{onClick:p,variant:"outline",size:"sm",className:"flex-1 min-w-[120px] bg-white/5 border-white/10 text-white hover:bg-primary/20 hover:border-primary/50 hover:text-white",children:[e.jsx(b,{className:"h-4 w-4 mr-2"}),"LinkedIn"]}),e.jsxs(r,{onClick:d,variant:"outline",size:"sm",className:"flex-1 min-w-[120px] bg-white/5 border-white/10 text-white hover:bg-primary/20 hover:border-primary/50 hover:text-white",children:[e.jsx(u,{className:"h-4 w-4 mr-2"}),"Twitter"]}),e.jsxs(r,{onClick:l,variant:"outline",size:"sm",className:"flex-1 min-w-[120px] bg-white/5 border-white/10 text-white hover:bg-primary/20 hover:border-primary/50 hover:text-white",children:[e.jsx(f,{className:"h-4 w-4 mr-2"}),"Facebook"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"This link displays proper preview images when shared on social media"})]}):e.jsxs("div",{className:s,children:[e.jsx(a,{className:"text-muted-foreground",children:"Share This Job"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Share link will be generated after saving the job"})]})};export{F as J};