PageSourceSearch

https://app.cashflowy.ai/assets/settings-vBURkgO1.js

js cashflowy.ai collected 2026-09-29 13:02:48 UTC 5,592 bytes, 1 lines download raw bytes

1import{H as w,n as I,r as d,d as A,t as g,bn as E,bo as P,j as e,a as Y,aW as k,aX as H,B as m,bp as j,aZ as O,aH as z,aI as _,aJ as L,aK as Q,bq as R,br as M,bs as q,bt as B}from"./main-CGjiTthq.js";import{G as x}from"./guarded-bbtc0vTO.js";import{T as F,a as K,b as v,c as t,d as U,e as i}from"./table-3amXY6oW.js";import{T as G,a as V,b as J,c as W}from"./tabs-CuYx-ctV.js";import{A as X}from"./add-service-dialog-yD0ab-gc.js";import{P as Z}from"./page-header-GpXd1HTu.js";import{u as $}from"./use-permissions-yxANvnbS.js";import{A as ee}from"./arrow-left-Oszhmy3s.js";import{P as se}from"./pencil-JejXzov4.js";import{T as ae}from"./trash-Cww9QTPz.js";import"./select-DhCO05sN.js";import"./index-CQzD7oZI.js";import"./index-QbAHuBRo.js";import"./chevron-up-Ca2UVhuQ.js";import"./textarea-Df1mW2vR.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"620fd87e3b2eb5c765315fb9507beebb7ff50556"};var n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="8c9ea8bd-f2f7-4368-9ff5-99429980374b",a._sentryDebugIdIdentifier="sentry-dbid-8c9ea8bd-f2f7-4368-9ff5-99429980374b")}catch{}})();function je(){const a=w(),{hasPermission:n}=$(),r=n("data.write"),{data:h=[]}=I(B()),[f,y]=d.useState("services"),[N,l]=d.useState(!1),[S,p]=d.useState(null),[u,c]=d.useState(null),b=A({...P(),onSuccess:()=>{a.invalidateQueries({queryKey:E.invoiceSettings}),c(null),g.success("Service deleted successfully")},onError:()=>{g.error("Failed to delete service"),c(null)}}),D=s=>{p(s),l(!0)},T=()=>{l(!1),p(null)},o=b.isPending,C=s=>s.toLocaleString("en-US",{style:"currency",currency:"USD"});return e.jsxs("div",{children:[e.jsxs(Y,{className:"btn btn-sm btn-neutral mb-2",to:"/invoices",children:[e.jsx(ee,{})," Invoices"]}),e.jsx(Z,{title:"Invoice Settings"}),e.jsx("p",{className:"mb-2",children:"Manage your invoice services and tax rates"}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(k,{className:"w-full",children:e.jsxs(G,{defaultValue:"services",onValueChange:y,children:[e.jsx(H,{className:"pb-0",children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[e.jsx(V,{className:"bg-transparent p-0 h-auto",children:e.jsx(J,{value:"services",className:"data-[state=active]:bg-transparent data-[state=active]:text-primary-700 data-[state=active]:shadow-none data-[state=active]:border-b-2 data-[state=active]:border-primary-700 rounded-none px-4 py-2",children:"Services"})}),f==="services"&&h.length>0&&e.jsx(x,{allowed:r,message:"You do not have permission to add services.",children:e.jsxs(m,{className:"bg-primary-700 hover:bg-primary-800",onClick:()=>l(!0),children:[e.jsx(j,{size:16}),e.jsx("span",{children:"Add Service"})]})})]})}),e.jsx(O,{className:"pt-6",children:e.jsx(W,{value:"services",className:"mt-0",children:h.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("p",{className:"mb-4",children:"You don't have any services yet."}),e.jsx(x,{allowed:r,message:"You do not have permission to add services.",children:e.jsxs(m,{className:"bg-primary-700 hover:bg-primary-800",onClick:()=>l(!0),children:[e.jsx(j,{size:16}),e.jsx("span",{children:"Add Service"})]})})]}):e.jsx("div",{className:"space-y-4",children:e.jsxs(F,{children:[e.jsx(K,{children:e.jsxs(v,{className:"bg-primary-50 hover:bg-primary-50",children:[e.jsx(t,{className:"text-primary-700",children:"Name"}),e.jsx(t,{className:"text-primary-700",children:"Description"}),e.jsx(t,{className:"text-primary-700 text-right",children:"Price"}),e.jsx(t,{className:"text-primary-700 text-center",children:"Account"}),e.jsx(t,{className:"text-primary-700 text-center",children:"Status"}),e.jsx(t,{className:"text-primary-700 text-right",children:"Actions"})]})}),e.jsx(U,{children:h.map(s=>e.jsxs(v,{className:"hover:bg-primary-50",children:[e.jsx(i,{className:"font-medium",children:s.name}),e.jsx(i,{children:s.description||"—"}),e.jsx(i,{className:"text-right",children:C(parseFloat(s.price))}),e.jsx(i,{className:"font-medium text-center",children:s.account}),e.jsx(i,{className:"text-center",children:e.jsx("span",{className:`badge ${s.visible?"badge-success":""}`,children:s.visible?"Active":"Inactive"})}),e.jsx(i,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(x,{allowed:r,message:"You do not have permission to edit services.",children:e.jsxs(m,{variant:"ghost",size:"icon",onClick:()=>D(s),className:"h-8 w-8 text-neutral-500 hover:text-primary-700 hover:bg-primary-50",children:[e.jsx(se,{size:16}),e.jsx("span",{className:"sr-only",children:"Edit"})]})}),e.jsx(x,{allowed:r,message:"You do not have permission to delete services.",children:e.jsxs(m,{variant:"ghost",size:"icon",onClick:()=>c(s.id),className:"h-8 w-8 text-neutral-500 hover:text-danger-600 hover:bg-danger-50",children:[e.jsx(ae,{size:16}),e.jsx("span",{className:"sr-only",children:"Delete"})]})})]})})]},s.id))})]})})})})]})}),e.jsx(X,{isOpen:N,onOpenChange:T,service:S}),e.jsx(z,{open:!!u,onOpenChange:s=>!s&&!o&&c(null),children:e.jsxs(_,{children:[e.jsxs(L,{children:[e.jsx(Q,{children:"Delete Service?"}),e.jsx(R,{children:"This action cannot be undone."})]}),e.jsxs(M,{className:"flex justify-center gap-4",children:[e.jsx(q,{disabled:o,children:"Cancel"}),e.jsx("button",{type:"button",className:"btn btn-error",disabled:o,onClick:()=>{u&&b.mutate(u)},children:o?"Deleting...":"Delete"})]})]})})]})]})}export{je as component};

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.