import{jsx as e,jsxs as r,Fragment as l}from"react/jsx-runtime";import{B as o}from"./button-BvFBRYHq.js";import{D as u,a as x,b as f,c as N,d as b,e as D}from"./dialog-BfGkTFdF.js";import{I as v}from"./input-qMvM9qch.js";import{L as y}from"./label-DMnntKPk.js";import{Loader2 as c,Gift as k}from"lucide-react";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-dialog";import"@radix-ui/react-label";function z({open:m,faction:t,bonusPercentage:n,loading:d,savingBonus:i,bonusMessage:a,onOpenChange:s,onBonusPercentageChange:p,onSave:h}){return e(u,{open:m,onOpenChange:s,children:r(x,{children:[r(f,{children:[e(N,{children:"Set Guild Bonus"}),e(b,{children:t&&r(l,{children:["Set topup bonus for ",e("strong",{children:t.name})," (ID: ",t.id,")"]})})]}),a&&e("div",{className:`p-3 rounded-lg text-sm ${a.type==="success"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:a.text}),e("div",{className:"space-y-4 py-4",children:d?e("div",{className:"flex items-center justify-center py-8",children:e(c,{className:"h-6 w-6 animate-spin"})}):r("div",{className:"space-y-2",children:[e(y,{htmlFor:"bonus-percentage",children:"Bonus Percentage (%)"}),r("div",{className:"flex items-center gap-2",children:[e(v,{id:"bonus-percentage",type:"number",min:"0",max:"100",step:"0.01",placeholder:"0",value:n,onChange:g=>p(g.target.value),className:"flex-1"}),e("span",{className:"text-muted-foreground",children:"%"})]}),r("p",{className:"text-xs text-muted-foreground",children:["Members of this guild will receive ",n||0,"% extra gold on topup."]})]})}),r(D,{children:[e(o,{variant:"outline",onClick:()=>s(!1),disabled:i,children:"Cancel"}),e(o,{onClick:h,disabled:i||d,children:i?r(l,{children:[e(c,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):r(l,{children:[e(k,{className:"mr-2 h-4 w-4"}),"Save Bonus"]})})]})]})})}export{z as BonusDialog};
