import{jsxs as l,jsx as e}from"react/jsx-runtime";import{C as y,b as C,c as N,d as f,a as x}from"./card-Zg0WOx-j.js";import{L as c}from"./label-DMnntKPk.js";import{I as n}from"./input-qMvM9qch.js";import{CheckCircle as i,Copy as s}from"lucide-react";import{B as o}from"./button-BvFBRYHq.js";import{useState as b}from"react";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-label";import"@radix-ui/react-slot";import"class-variance-authority";const I=({urls:a,title:d="Callback URLs",description:p="Copy these URLs to your payment gateway dashboard"})=>{const[t,m]=b(null),r=(h,u)=>{navigator.clipboard.writeText(h),m(u),setTimeout(()=>m(null),2e3)};return l(y,{children:[l(C,{children:[e(N,{children:d}),e(f,{children:p})]}),l(x,{className:"space-y-4",children:[a.return_url&&l("div",{className:"space-y-2",children:[e(c,{children:"Return URL"}),l("div",{className:"flex gap-2",children:[e(n,{value:a.return_url,readOnly:!0,className:"font-mono text-xs"}),e(o,{type:"button",variant:"outline",size:"sm",onClick:()=>r(a.return_url,"return"),children:t==="return"?e(i,{className:"w-4 h-4 text-green-500"}):e(s,{className:"w-4 h-4"})})]})]}),a.callback_url&&l("div",{className:"space-y-2",children:[e(c,{children:"Callback URL"}),l("div",{className:"flex gap-2",children:[e(n,{value:a.callback_url,readOnly:!0,className:"font-mono text-xs"}),e(o,{type:"button",variant:"outline",size:"sm",onClick:()=>r(a.callback_url,"callback"),children:t==="callback"?e(i,{className:"w-4 h-4 text-green-500"}):e(s,{className:"w-4 h-4"})})]})]}),a.notify_url&&l("div",{className:"space-y-2",children:[e(c,{children:"Notify URL"}),l("div",{className:"flex gap-2",children:[e(n,{value:a.notify_url,readOnly:!0,className:"font-mono text-xs"}),e(o,{type:"button",variant:"outline",size:"sm",onClick:()=>r(a.notify_url,"notify"),children:t==="notify"?e(i,{className:"w-4 h-4 text-green-500"}):e(s,{className:"w-4 h-4"})})]})]}),a.cancel_url&&l("div",{className:"space-y-2",children:[e(c,{children:"Cancel URL"}),l("div",{className:"flex gap-2",children:[e(n,{value:a.cancel_url,readOnly:!0,className:"font-mono text-xs"}),e(o,{type:"button",variant:"outline",size:"sm",onClick:()=>r(a.cancel_url,"cancel"),children:t==="cancel"?e(i,{className:"w-4 h-4 text-green-500"}):e(s,{className:"w-4 h-4"})})]})]})]})]})};export{I as CallbackUrlsCard};
