import{c as y,r as N,j as t,b as _,L as w}from"./app-BiexncSX.js";import{T as v,a as C,b as g,c as x,d as S,e as h}from"./table-DPbxE3sd.js";import{C as R,a as T,b as A}from"./card-DJd5CcuI.js";import{t as j}from"./index-BphRgCCf.js";import{C as E}from"./ConfirmActionAlertButton-DvY_CB02.js";import{B as k}from"./badge-BL2IjDE_.js";import{D as B}from"./sun-D646Bdfj.js";import{C as L}from"./chevron-right-D-bIFB2o.js";/* empty css            */import"./utils-DvRnx1Xn.js";import"./alert-dialog-Sv-TtVWh.js";import"./button-Cwvd_D5X.js";import"./index-Bx9iUFeV.js";import"./index-BKRdUh5V.js";import"./index-DRVc8jnD.js";import"./index-CqDcnRSI.js";import"./spinner-BshPoFqP.js";import"./loader-circle-C36m3ppM.js";import"./createLucideIcon-CiyItOCI.js";import"./lucide-react-C-jOYeYF.js";import"./send-D-Y6pdiK.js";import"./wifi-yGaHKi1T.js";import"./bed-double-DlbqgL2k.js";import"./phone-Bieilqj-.js";import"./check-Do_LJdyj.js";import"./chevron-up-D0SwuXIU.js";import"./chevron-left-CfTNJLZd.js";import"./chevrons-up-down-B23gAN10.js";import"./shield-check-BcGX3gbR.js";import"./triangle-alert-Dp60wOMH.js";import"./youtube-C8R3zjo2.js";import"./plus-Cm0TKlUw.js";import"./clock-CXI9z3-R.js";import"./credit-card-DrNFemOT.js";import"./ellipsis-BcGSaUdp.js";import"./globe-CZ3jv1ui.js";import"./house-CmuRWHdh.js";import"./key-Dw2ORQjm.js";import"./loader-uls-v5oU.js";import"./minus-BQGRvjuE.js";import"./monitor-4BAY-8Q0.js";import"./save-BnaHUyyd.js";import"./search-DVB94mIy.js";import"./sparkles-duG_NONK.js";import"./trash-2-B8EoOc8P.js";import"./users-B6ln6dzh.js";import"./utensils-CU7nxPop.js";import"./x-Cp4MPESs.js";import"./index-BLf-KPWz.js";function ke(r){const e=y.c(15),{exchange_rates:s}=r,[f,u]=N.useState(!1);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=async()=>{u(!0),_.get("/dashboard/exchange-rates/add-record",{},{preserveScroll:!0,onSuccess:()=>{j.success("Rates updated!"),u(!1)},onError:()=>{j.error("Something went worgn!"),u(!1)}})},e[0]=n):n=e[0];const b=n;let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{children:"Updated Exchange Rates"}),e[1]=m):m=e[1];let a;e[2]!==f?(a=t.jsx(E,{title:"Add Exchange Rates",description:"This will fetch the latest rates from the external API and store a new record.",icon:"ChartCandlestick",confirmText:"Add New Rate",variant:"default",onConfirm:b,loading:f,addIcon:!0}),e[2]=f,e[3]=a):a=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs(w,{className:"text-sm cursor-pointer flex gap-2 justify-center items-center hover:bg-neutral-1s00 dark:hover:bg-neutral-800 px-2 py-1.5 rounded-sm",href:"/dashboard/exchange-rates",children:["See All ",t.jsx(L,{className:"w-5 h-5"})]}),e[4]=d):d=e[4];let o;e[5]!==a?(o=t.jsxs("div",{className:"flex flex-1 justify-between items-center gap-1 border-b pb-2 text-sm",children:[m,t.jsxs("div",{className:"flex gap-4",children:[a,d]})]}),e[5]=a,e[6]=o):o=e[6];let i;e[7]!==s?(i=s.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center space-y-4",children:[t.jsx("div",{className:"p-4 rounded-full bg-muted",children:t.jsx(B,{className:"w-10 h-10 text-primary"})}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"No Price Modifiers Yet"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Add modifiers like weekday/weekend adjustments, holiday pricing, or custom discounts to your room rates."})]})]}):t.jsx(t.Fragment,{children:t.jsxs(v,{children:[t.jsx(C,{children:t.jsxs(g,{children:[t.jsx(x,{children:"#"}),t.jsx(x,{children:"Last Update At"}),t.jsx(x,{children:"Rates"}),t.jsx(x,{className:" text-center",children:"Updated By"})]})}),t.jsx(S,{children:s.map(U)})]})}),e[7]=s,e[8]=i):i=e[8];let l;e[9]!==o||e[10]!==i?(l=t.jsxs(R,{className:"px-4",children:[o,i]}),e[9]=o,e[10]=i,e[11]=l):l=e[11];let c;e[12]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(T,{}),e[12]=c):c=e[12];let p;return e[13]!==l?(p=t.jsxs(A,{className:" flex-1 py-4 rounded-sm shadow-none gap-2 h-fit bg-card/60",children:[l,c]}),e[13]=l,e[14]=p):p=e[14],p}function U(r){return t.jsxs(g,{children:[t.jsx(h,{children:r.id}),t.jsx(h,{className:"truncate max-w-34",children:r.last_updated_at?new Date(r.last_updated_at).toLocaleString():"-"}),t.jsx(h,{children:t.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(r.rates).map(D)})}),t.jsx(h,{className:" text-center",children:t.jsx(k,{variant:r.updated_by==="system"?"outline":"default",children:r.updated_by})})]},r.id)}function D(r){const[e,s]=r;return t.jsxs("div",{className:"px-2 py-1 border rounded text-xs bg-muted",children:[t.jsx("span",{className:"font-medium",children:e}),": ",String(s)]},e)}export{ke as default};
