PageSourceSearch

https://app.auritrack.com/assets/IncomeOverview.DB8HV4hv.js

js auritrack.com collected 2026-10-02 15:47:27 UTC 11,825 bytes, 1 lines download raw bytes

1var e=Object.defineProperty,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,t=(s,l,a)=>l in s?e(s,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[l]=a,n=(e,n)=>{for(var i in n||(n={}))l.call(n,i)&&t(e,i,n[i]);if(s)for(var i of s(n))a.call(n,i)&&t(e,i,n[i]);return e};import{r as i,n as o,o as r,e as c,j as d,I as x,p as m,B as u,x as f,h as p,D as h,T as g}from"./index.ix7v2k0N.js";import{d as b}from"./delete.D-l8v6jw.js";import{u as v,a as j,b as N}from"./useIncomes.DY9kKwPw.js";import{a as y}from"./dateFormat.Dj9rAS3d.js";import{u as w}from"./useDownloadFile.WdVIOolT.js";import{k,r as _,u as O}from"./vendor-react.BSW60Aoa.js";import{u as C}from"./vendor-ui.Jm3Mep1G.js";import{T as E}from"./Tag.Cq3z2_86.js";import{c as I}from"./vendor-utils.CTPgnr8M.js";import"./tagColors.CMQOs56N.js";const S=()=>{var e,s,l;const{isDarkTheme:a}=_.useContext(g),t=i({queryKeys:["transactions","funds","income","fund-income"]}),S=k(),{alert:T}=o(),{handleApiError:D}=r(),[A,P]=_.useState(!1),{mutate:q,isLoading:L}=v(),{data:z,isLoading:F}=j(S.id||""),{currentUser:$}=c(),{downloadFile:B,loading:K}=w("income_files",!1),{mutate:M,isLoading:R}=N(),V=O(),{register:Y,setValue:G,handleSubmit:U,watch:H,formState:{errors:J}}=C({defaultValues:{note:""}});_.useEffect(()=>{(null==z?void 0:z.description)&&G("note",z.description)},[z,G]);const Q=H("note"),W=(null==z?void 0:z.description)||"";return d.jsxs("div",{children:[d.jsxs("div",{className:"z-50 flex h-[72px] w-full items-center justify-between px-4 lg:px-6",children:[d.jsxs("div",{className:"flex items-center gap-4 lg:gap-6",children:[d.jsx("button",{type:"button",onClick:()=>V(-1),className:"rounded-full bg-card-soft p-[8px] transition-colors hover:bg-card-soft-hover dark:bg-dark-card-soft dark:hover:bg-dark-card-soft-hover","aria-label":"go back",children:d.jsx(x,{icon:"hugeicons:arrow-left-02"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-12 xs:text-14 sm:text-15 hover:global-subtext font-semibold text-charleston-green-30 transition-all lg:text-lg",onClick:()=>V(m.income),role:"button",tabIndex:0,onKeyPress:e=>{"Enter"===e.key&&V(m.income)},children:"Income"}),d.jsx(x,{icon:"hugeicons:arrow-right-01",width:"20",height:"20"}),d.jsx("span",{className:"text-12 xs:text-14 sm:text-15 font-semibold lg:text-lg",children:null==z?void 0:z.label})]})]}),d.jsxs("div",{className:"hidden h-max gap-4 lg:flex",children:[d.jsx(u,{className:"gap-3 !text-[12px]",variant:"greyOutline",onClick:()=>{V(`/edit-income/${S.id}`)},icon:d.jsx(x,{icon:"hugeicons:license-draft",width:"20",height:"20"}),children:"Edit Entry"}),d.jsx(u,{className:"!p-3",variant:"greyOutline",onClick:()=>P(!0),icon:d.jsx("img",{src:b,alt:"delete"})})]})]}),d.jsxs("div",{className:"big-container space-y-4 px-4 pb-16 lg:flex lg:gap-6 lg:space-y-0 lg:px-6 lg:pb-0",children:[d.jsxs("div",{className:"global-card flex flex-col p-6 shadow-card lg:h-[c
1alc(100vh-186px)] lg:w-[392px] lg:shrink-0 lg:overflow-y-auto",children:[d.jsxs("div",{className:"primary-border flex w-full items-center justify-between border-b pb-[18px]",children:[d.jsx("h3",{className:"text-[16px] font-semibold",children:"Income Overview"}),d.jsxs("div",{className:"flex gap-4 lg:hidden",children:[d.jsx(u,{className:"!p-3",variant:"greyOutline",onClick:()=>V(`/edit-income/${S.id}`),icon:d.jsx(x,{icon:"hugeicons:license-draft",width:"20",height:"20"})}),d.jsx(u,{className:"!p-3",variant:"greyOutline",onClick:()=>P(!0),icon:d.jsx("img",{src:b,alt:"delete",className:"h-[20px] w-[20px]"})})]})]}),F&&!z?d.jsxs("div",{className:"my-6 flex h-[161px] flex-col gap-9 rounded-card bg-card-soft p-5 dark:bg-dark-card-soft",children:[d.jsx(f,{className:"!h-5 w-full max-w-[150px]"}),d.jsxs("div",{className:"mt-auto flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"w-1/2 space-y-1",children:[d.jsx(f,{className:"!h-4 w-full max-w-[80px]"}),d.jsx(f,{className:"!h-5 w-full max-w-[150px]"})]}),d.jsxs("div",{className:"w-1/2 space-y-1",children:[d.jsx(f,{className:"ml-auto !h-4 w-full max-w-[80px]"}),d.jsx(f,{className:"!h-4 w-full max-w-[150px]"})]})]})]}):d.jsxs("div",{className:"my-6 flex flex-col gap-5 rounded-card bg-card-soft p-5 dark:bg-dark-card-soft",children:[d.jsxs("div",{className:"global-text flex items-center gap-2 text-[14px] font-bold capitalize",children:[d.jsx(x,{icon:"hugeicons:money-01",className:"size-5"}),null==z?void 0:z.label]}),d.jsxs("div",{className:"flex items-end justify-between gap-4",children:[d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("p",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Amount"}),d.jsx("h3",{className:"font-google-sans-code text-[22px] font-bold tracking-tight text-green-accent-500 dark:text-green-accent-300",children:p(Number(null==z?void 0:z.amount),null==$?void 0:$.preferred_currency)})]}),d.jsxs("div",{className:"flex flex-col items-end gap-1 text-right",children:[d.jsx("p",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Date received"}),d.jsx("p",{className:"global-text text-[13px] font-bold",children:y((null==z?void 0:z.date)||"")})]})]})]}),d.jsxs("div",{className:"primary-border flex items-center justify-between border-b border-t py-4",children:[d.jsx("div",{className:"text-[16px] font-bold",children:"Attached Files"}),d.jsx("div",{className:"flex h-[32px] w-[32px] items-center justify-center rounded-btn bg-card-soft text-[12px] font-semibold dark:bg-dark-card-soft",children:(null==z?void 0:z.file_path)?"1":"0"})]}),(null==z?void 0:z.file_path)&&d.jsxs("div",{className:I("rounded-16 text-14 global-text mt-6 flex items-center justify-between bg-card-soft px-4 py-5 font-medium dark:bg-dark-card-soft",{"subitems-bg":!a,"subitems-bg-dark":a}),children:[null==z?void 0:z.file_path,d.jsx(u,{icon:K?d.jsx(x,{icon:"eos-icons:loading",width:"18",height:"18"}):d.jsx(x,{icon:"hugeicons:download-04",width:"18px",height:"18px"}),onClick:()=>B((null==z?void 0:z.file_path)||""),disabled:K,variant:"greyOutline",className:"!h-max !border-0 !p-0"})]})]}),d.jsxs("div",{className:"global-card relative flex-1 p-6 shadow-card lg:h-[c
1alc(100vh-186px)] lg:overflow-y-auto",children:[d.jsx("div",{className:"primary-border flex w-full items-center justify-between border-b pb-[18px]",children:d.jsx("h3",{className:"text-[16px] font-semibold",children:"More Details"})}),d.jsx("div",{className:"my-6 rounded-card bg-card-soft p-5 dark:bg-dark-card-soft",children:d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-5 lg:grid-cols-5",children:[d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("h4",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Label"}),d.jsx("p",{className:"global-text text-[13px] font-bold",children:null==z?void 0:z.label})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("h4",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Source"}),d.jsx("p",{className:"global-text text-[13px] font-bold",children:(null==z?void 0:z.income_source)||"-"})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("h4",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Tag"}),d.jsx("div",{children:d.jsx(E,{label:null==(e=null==z?void 0:z.tag)?void 0:e.name,color:(null==(s=null==z?void 0:z.tag)?void 0:s.color)||""})})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("h4",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Received Into"}),d.jsx("p",{className:"global-text text-[13px] font-bold",children:(null==z?void 0:z.fund_source_name)||"-"})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("h4",{className:"text-11 font-google-sans-code font-semibold uppercase tracking-[0.04em] text-ink-3",children:"Recurring"}),(null==z?void 0:z.is_recurring)?d.jsxs("div",{className:"global-text flex items-center gap-1 text-[13px] font-bold",children:["Yeah",(null==z?void 0:z.frequency)&&d.jsxs("div",{className:"global-subtext flex items-center gap-1 font-medium",children:[d.jsx("span",{className:"size-1 rounded-full bg-ink-3"}),d.jsx("span",{children:null==z?void 0:z.frequency})]})]}):d.jsx("span",{className:"global-text text-[13px] font-bold",children:"Nope"})]})]})}),d.jsxs("form",{className:"flex flex-col",onSubmit:U(e=>{return s=void 0,l=null,a=function*(){var s;try{const l={label:null==z?void 0:z.label,income_source:null==z?void 0:z.income_source,fund_source_name:null==z?void 0:z.fund_source_name,fund_source_id:null==z?void 0:z.fund_source_id,tag:null==(s=null==z?void 0:z.tag)?void 0:s.id,date:null==z?void 0:z.date,is_recurring:null==z?void 0:z.is_recurring,frequency:null==z?void 0:z.frequency,user_id:null==z?void 0:z.user_id,amount:null==z?void 0:z.amount,file_path:null==z?void 0:z.file_path,description:e.note};M({id:S.id||"",body:l},{onSuccess:()=>{t(),T.success("Description saved successfully")},onError:e=>{D(e)}})}catch(l){D(l)}},new Promise((e,t)=>{var n=e=>{try{o(a.next(e))}catch(s){t(s)}},i=e=>{try{o(a.throw(e))}catch(s){t(s)}},o=s=>s.done?e(s.value):Promise.resolve(s.value).then(n,i);o((a=a.apply(s,l)).next())});var s,l,a}),children:[d.jsx("h3",{className:"text-[14px] font-bold",children:"Additional Note/Descriptions"}),d.jsx("p",{className:"text-[12px] font-medium text-charleston-green-30",children:"Add any extra notes or descriptions here."}),d.jsxs("div",{className:"relative my-6",children:[d.jsx("textarea",n({className:"block h-[150px] w-full rounded-btn bg-card-soft px-3 py-2 text-[14px] outline-none focus:ring-1 focus:ring-brand dark:bg-dark-card-soft"},Y("note"))),J.note&&d.jsx("p",{className:"mt-1 text-[12px] text-red-500",children:J.note.message}),d.jsxs("button",{type:"button",className:"absolute bottom-4 right-4 flex items-center gap-2 text-[12px] font-medium text-orange-accent-100 transition-all hover:text-orange-accent-90",onClick:()=>T.info("This feature is not available yet."),children:[d.jsx("img",{src:"/assets/brush.B4n5YEft.svg",alt:""}),"Generate with AI"]})]}),d.jsx(u,{className:"w-[150px]",type:"submit",disabled:R||!(Q!==W&&""!==Q.trim()),children:"Save"})]}),d.jsxs("div",{className:"mt-6 flex h-max w-full gap-4 lg:hidden",children:[d.jsx(u,{className:"w-full gap-3 !text-[12px]",variant:"greyOutline",onClick:()=>V(`/edit-income/${S.id}`),icon:d.jsx(x,{icon:"hugeicons:license-draft",width:"20",height:"20"}),children:"Edit Entry"}),d.jsx(u,{className:"!p-3",variant:"greyOutline",onClick:()=>P(!0),children:d.jsx("img",{src:b,alt:"delete"})})]})]})]}),A&&d.jsx(h,{modalTitle:"Are you sure you want to delete this income entry?",closeModal:()=>{P(!1)},isLoading:L,action:()=>{S.id&&q(S.id,{onSuccess:()=>{T.success("Income deleted successfully"),t(),P(!1),V(m.income)},onError:e=>{D(e)}})},children:d.jsxs("div",{className:"flex flex-col gap-3",children:[(null==z?void 0:z.fund_source_name)&&d.jsxs("p",{className:"text-sm font-normal",children:[p((null==z?void 0:z.amount)||0,null==$?void 0:$.preferred_currency,!0)," ","will be removed from the"," ",d.jsx("span",{className:"font-semibold",children:null==z?void 0:z.fund_source_name})," account balance and your total income."]}),(null==z?void 0:z.profile_id)&&d.jsxs("p",{className:"text-sm font-normal",children:["This income is linked to the profile"," ",d.jsx("span",{className:"font-semibold",children:null==(l=null==z?void 0:z.profile)?void 0:l.full_name}),". Deleting this income will affect the total received from this person."]}),d.jsx("p",{className:"text-sm font-normal",children:"This action cannot be undone."})]})})]})};export{S 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.