1import{j as e,a as j}from"./index-DpvbCM25.js";import{f as g}from"./format-DWucl_-U.js";function u({feeError:d,feeLoading:c,feeRows:r,intimeRates:o,loadFees:p,saveFeeRow:h,savingFeeId:n,savingIntimeKey:i,setIntimeRates:m,setSavingIntimeKey:x,updateFeeField:t}){return e.jsxs("div",{className:"rounded-2xl bg-white p-6 shadow-md border border-slate-100 dark:bg-[#131c31] dark:border-slate-700/30",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold",children:"Fees"}),e.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:"Vul per kanaal fee %, vast bedrag, verzendkosten en extra kosten in."})]}),e.jsx("button",{onClick:()=>void p(),className:"rounded-xl border border-slate-300 px-4 py-2 text-sm dark:border-slate-700",children:"Vernieuwen"})]}),d?e.jsx("div",{className:"mb-4 rounded-xl bg-red-50 px-4 py-3 text-sm text-red-600 dark:bg-red-900/20 dark:text-red-300",children:d}):null,e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-200 text-left dark:border-slate-700",children:[e.jsx("th",{className:"px-3 py-3",children:"Kanaal"}),e.jsx("th",{className:"px-3 py-3",children:"Fee %"}),e.jsx("th",{className:"px-3 py-3",children:"Vast bedrag"}),e.jsx("th",{className:"px-3 py-3",children:"Verzendkosten"}),e.jsx("th",{className:"px-3 py-3",children:"Extra kosten"}),e.jsx("th",{className:"px-3 py-3",children:"Bijgewerkt"}),e.jsx("th",{className:"px-3 py-3 text-right",children:"Actie"})]})}),e.jsx("tbody",{children:c?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"px-3 py-6 text-slate-500 dark:text-slate-400",children:"Laden..."})}):r.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"px-3 py-6 text-slate-500 dark:text-slate-400",children:"Geen fees gevonden"})}):r.map(a=>e.jsxs("tr",{className:"border-b border-slate-100 dark:border-slate-800",children:[e.jsx("td",{className:"px-3 py-3 font-medium",children:a.name}),e.jsx("td",{className:"px-3 py-3",children:e.jsx("input",{value:a.fee_percent??"",onChange:s=>t(a.channel_id,"fee_percent",s.target.value),className:"w-24 rounded-lg border border-slate-300 bg-white px-3 py-2 dark:border-slate-700 dark:bg-slate-950"})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx("input",{value:a.fixed_fee??"",onChange:s=>t(a.channel_id,"fixed_fee",s.target.value),className:"w-28 rounded-lg border border-slate-300 bg-white px-3 py-2 dark:border-slate-700 dark:bg-slate-950"})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx("input",{value:a.shipping_cost??"",onChange:s=>t(a.channel_id,"shipping_cost",s.target.value),className:"w-28 rounded-lg border border-slate-300 bg-white px-3 py-2 dark:border-slate-700 dark:bg-slate-950"})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx("input",{value:a.extra_cost??"",onChange:s=>t(a.channel_id,"extra_cost",s.target.value),className:"w-28 rounded-lg border border-slate-300 bg-white px-3 py-2 dark:border-slate-700 dark:bg-slate-950"})}),e.jsx("td",{className:"px-3 py-3 text-slate-500 dark:text-slate-400",children:g(a.updated_at)}),e.jsx("td",{className:"px-3 py-3 text-right",children:e.jsx("button",{type:"button",onClick:()=>void h(a),disabled:n===a.channel_id,className:"rounded-xl bg-sky-600 px-4 py-2 text-sm font-semibold text-white hover:bg-sky-700 disabled:opacity-60",children:n===a.channel_id?"Opslaan...":"Opslaan"})})]},a.channel_id))})]})}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h4",{className:"text-base font-bold mb-1",children:"Intime tarieven"}),e.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"Verzendkosten bij zelf verzenden via Intime. Extra kosten komen automatisch te vervallen."}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:o.map(a=>e.jsxs("div",{className:"rounded-xl border border-slate-200 dark:border-slate-700 p-3",children:[e.jsx("div",{className:"text-sm font-semibold mb-2",children:a.option_label}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-slate-500 text-sm",children:"â¬"}),e.jsx("input",{type:"number",step:"0.01",value:a.rate,onChange:s=>m(b=>b.map(l=>l.option_key===a.option_key?{...l,rate:s.target.value}:l)),className:"flex-1 rounded-lg border border-slate-300 px-3 py-1.5 text-sm dark:border-slate-600 dar
1k:bg-[#131c31]"}),e.jsx("button",{onClick:async()=>{x(a.option_key);try{await j("intime-rates/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({option_key:a.option_key,rate:Number(a.rate)})})}finally{x(null)}},disabled:i===a.option_key,className:"rounded-lg bg-sky-600 px-3 py-1.5 text-xs text-white hover:bg-sky-700 disabled:opacity-50",children:i===a.option_key?"...":"â"})]})]},a.option_key))})]})]})}export{u as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.