PageSourceSearch

https://the-gazel.lovable.app/assets/CustomReports-BkkaR8NW.js

js the-gazel.lovable.app collected 2026-10-03 03:50:39 UTC 21,737 bytes, 31 lines download raw bytes

1import{j as e}from"./ui-BcZpBtGC.js";import{r as m}from"./vendor-CbTYwD9p.js";import{u as K,d as _,C as L,e as O,g as A,av as X,h as U,a as B,Z,Q as k,V as $,W as I,X as M,Y as v,B as w,aM as ee,D as Q,al as q,r as V,v as G,w as z,aS as W,E as F,m as H,a0 as se,ad as ae,ab as te}from"./index-D4z10nuM.js";import{P as ne}from"./PremiumFeature-B48A-p7Q.js";import{u as le}from"./useTransactionReports-CJJtk5rA.js";import{C as J}from"./checkbox-BiZMpq0L.js";import{C as P}from"./CurrencyDisplay-Czr68xmm.js";import{P as re}from"./play-CSAYtYxV.js";import{E as ie}from"./eye-DHwVhvdt.js";import{T as ce}from"./trash-2-DGkDE4Jg.js";import"./progress-DuoHXgLN.js";import"./jspdf.plugin.autotable-DwhxRVu1.js";import"./PrioritySupport-CwJ2vb-5.js";import"./router-C21RS5Se.js";import"./skeleton-8_H0rhmR.js";import"./gem-Ky2B3fRN.js";import"./budgetAnalytics-D4gKf59v.js";import"./parseISO-jbOw4T8D.js";import"./constants-DQX8fu4l.js";import"./endOfYear-D2YKXj2B.js";import"./isWithinInterval-qRk7nEIg.js";import"./startOfYear-CRigkeXM.js";import"./addMonths-BNlrzca5.js";import"./form-P_thZwXU.js";import"./user-BCFYjlcR.js";function oe(){K();const{toast:l}=_(),f=new Date().getFullYear().toString(),{monthlyData:T,quarterlyData:x,categoryData:b,totalIncome:u,totalExpenses:R,totalProfit:j,isLoading:S}=le(f),[d,g]=m.useState([{id:"1",name:"Q4 Business Expense Analysis",type:"Expense Analysis",lastRun:"2024-01-15",schedule:"Monthly",metrics:["Total Expenses","Expense by Category","Monthly Trends"],dateRange:"last-quarter",createdAt:"2024-01-01"},{id:"2",name:"Annual Tax Deduction Summary",type:"Deduction Summary",lastRun:"2024-01-10",schedule:"Quarterly",metrics:["Tax Deductions","Business Mileage","Home Office Expenses"],dateRange:"ytd",createdAt:"2024-01-01"},{id:"3",name:"Income Tracking Dashboard",type:"Income Tracking",lastRun:"2024-01-12",schedule:"Weekly",metrics:["Total Income","Income Sources","Year-over-Year Growth"],dateRange:"last-year",createdAt:"2024-01-01"}]),r=t=>{const s={name:t.name,type:t.type,dateRange:t.dateRange,generatedAt:new Date().toISOString(),metrics:{}};return t.metrics.forEach(n=>{switch(n){case"Total Income":s.metrics["Total Income"]=u.toLocaleString();break;case"Total Expenses":s.metrics["Total Expenses"]=R.toLocaleString();break;case"Net Profit":s.metrics["Net Profit"]=j.toLocaleString();break;case"Monthly Trends":s.monthlyData=T;break;case"Quarterly Comparison":s.quarterlyData=x;break;case"Expense by Category":s.categoryData=b;break;case"Tax Deductions":const c=b.reduce((o,i)=>o+i.value,0);s.metrics["Tax Deductions"]=c.toLocaleString();break;default:s.metrics[n]="Data not available"}}),s};return{savedReports:d,createReport:async t=>{try{const s={...t,id:Date.now().toString(),lastRun:new Date().toISOString().split("T")[0],createdAt:new Date().toISOString().split("T")[0]};return s.data=r(s),g(n=>[s,...n]),l({title:"Report Created",description:`"${t.name}" has been created successfully with real data.`}),s}catch(s){throw l({title:"Error",description:"Failed to create report. Please try again.",variant:"destructive"}),s}},updateReport:async(t,s)=>{try{g(n=>n.map(c=>{if(c.id===t){const o={...c,...s,lastRun:new Date().toISOString().split("T")[0]};return o.data=r(o),o}return c})),l({title:"Report Updated",description:"Report has been updated successfully with fresh data."})}catch(n){throw l({title:"Error",description:"Failed to update report. Please try again.",variant:"destructive"}),n}},deleteReport:async t=>{try{const s=d.find(n=>n.id===t);g(n=>n.filter(c=>c.id!==t)),l({title:"Report Deleted",description:`"${s==null?void 0:s.name}" has been deleted successfully.`})}catch(s){throw l({title:"Error",description:"Failed to delete report. Please try again.",variant:"destructive"}),s}},runReport:async t=>{try{const s=d.find(c=>c.id===t);if(!s)throw new Error("Report not found");const n=r(s);return g(c=>c.map(o=>o.id===t?{...o,lastRun:new Date().toISOString().split("T")[0],data:n}:o)),l({title:"Report Generated",description:`"${s.name}" has been generated with the latest data.`}),{...s,data:n}}catch(s){throw l({title:"Error",description:"Failed to run report. Please try again.",variant:"destructive"}),s}},exportReport:async(t,s)=>{try{const n=d.find(o=>o.id===t);if(!n)throw new Error("Report not found");const c=n.data||r(n);if(s==="pdf"){const o=`
2Report: ${n.name}
3Type: ${n.type}
4Generated: ${new Date().toLocaleString()}
5Date Range: ${n.dateRange}
6
7METRICS:
8${Object.entries(c.metrics).map(([h,Y])=>`${h}: ${Y}`).join(`
9`)}
10
11${c.monthlyData?`
12MONTHLY DATA:
13${c.monthlyData.map(h=>`${h.month}: Income $${h.income}, Expenses $${h.expenses}, Profit $${h.profit}`).join(`
14`)}
15`:""}
16
17${c.categoryData?`
18EXPENSE CATEGORIES:
19${c.categoryData.map(h=>`${h.name}: $${h.value}`).join(`
20`)}
21`:""}
22        `.trim(),i=new Blob([o],{type:"text/plain"}),E=URL.createObjectURL(i),N=document.createElement("a");N.href=E,N.download=`${n.name.replace(/\s+/g,"-")}-${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(E)}else{let o=`Report,${n.name}
23Type,${n.type}
24Generated,${new Date().toLocaleString()}
25
26`;o+=`Metric,Value
27`,Object.entries(c.metrics).forEach(([h,Y])=>{o+=`${h},${Y}
28`}),c.monthlyData&&(o+=`
29Month,Income,Expenses,Profit
30`,c.monthlyData.forEach(h=>{o+=`${h.month},${h.income},${h.expenses},${h.profit}
31`}));const i=new Blob([o],{type:"text/csv"}),E=URL.createObjectURL(i),N=document.createElement("a");N.href=E,N.download=`${n.name.replace(/\s+/g,"-")}-${new Date().toISOString().split("T")[0]}.${s}`,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(E)}l({title:"Export Complete",description:`"${n.name}" has been exported as ${s.toUpperCase()}.`})}catch(n){throw l({title:"Export Failed",description:"Failed to export report. Please try again.",variant:"destructive"}),n}},isLoading:S}}function de({onCreateReport:l}){const[f,T]=m.useState(""),[x,b]=m.useState(""),[u,R]=m.useState([]),[j,S]=m.useState(""),[d,g]=m.useState("manual"),[r,D]=m.useState(!1),a=[{value:"expense-analysis",label:"Expense Analysis"},{value:"income-tracking",label:"Income Tracking"},{value:"deduction-summary",label:"Deduction Summary"},{value:"tax-projection",label:"Tax Projection"},{value:"business-performance",label:"Business Performance"},{value:"investment-analysis",label:"Investment Analysis"}],y=["Total Income","Total Expenses","Net Profit","Tax Deductions","Tax Liability","Expense by Category","Income Sources","Monthly Trends","Quarterly Comparison","Year-over-Year Growth","Business Mileage","Home Office Expenses","Professional Services","Equipment & Supplies"],p=[{value:"manual",label:"Manual"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"quarterly",label:"Quarterly"}],C=s=>{R(n=>n.includes(s)?n.filter(c=>c!==s):[...n,s])},t=async()=>{var s;if(!(!f||!x||u.length===0||!j)){D(!0);try{await l({name:f,type:((s=a.find(n=>n.value===x))==null?void 0:s.label)||x,metrics:u,dateRange:j,schedule:d}),T(""),b(""),R([]),S(""),g("manual")}finally{D(!1)}}};return e.jsxs(L,{children:[e.jsxs(O,{children:[e.jsxs(A,{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-5 w-5"}),"Report Builder"]}),e.jsx(U,{children:"Create custom reports with the metrics that matter to you"})]}),e.jsxs(B,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Report Name"}),e.jsx(Z,{placeholder:"Enter report name",value:f,onChange:s=>T(s.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Report Type"}),e.jsxs(k,{value:x,onValueChange:b,children:[e.jsx($,{children:e.jsx(I,{placeholder:"Select report type"})}),e.jsx(M,{children:a.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Date Range"}),e.jsxs(k,{value:j,onValueChange:S,children:[e.jsx($,{children:e.jsx(I,{placeholder:"Select date range"})}),e.jsxs(M,{children:[e.jsx(v,{value:"last-30-days",children:"Last 30 Days"}),e.jsx(v,{value:"last-quarter",children:"Last Quarter"}),e.jsx(v,{value:"last-year",children:"Last Year"}),e.jsx(v,{value:"ytd",children:"Year to Date"}),e.jsx(v,{value:"custom",children:"Custom Range"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Schedule"}),e.jsxs(k,{value:d,onValueChange:g,children:[e.jsx($,{children:e.jsx(I,{placeholder:"Select schedule"})}),e.jsx(M,{children:p.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-3 block",children:"Metrics to Include"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:y.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(J,{id:s,checked:u.includes(s),onCheckedChange:()=>C(s)}),e.jsx("label",{htmlFor:s,className:"text-sm",children:s})]},s))})]}),e.jsxs(w,{onClick:t,disabled:!f||!x||u.length===0||!j||r,className:"w-full",children:[e.jsx(ee,{className:"h-4 w-4 mr-2"}),r?"Creating Report...":"Create Custom Report"]})]})]})}function me({report:l,onSave:f,trigger:T}){const[x,b]=m.useState(!1),[u,R]=m.useState(l.name),[j,S]=m.useState(l.type),[d,g]=m.useState(l.metrics),[r,D]=m.useState(l.dateRange),[a,y]=m.useState(l.schedule),[p,C]=m.useState(!1);m.useEffect(()=>{x&&(R(l.name),S(l.type),g(l.metrics),D(l.dateRange),y(l.schedule))},[x,l]);const t=["Expense Analysis","Income Tracking","Deduction Summary","Tax Projection","Business Performance","Investment Analysis"],s=["Total Income","Total Expenses","Net Profit","Tax Deductions","Tax Liability","Expense by Category","Income Sources","Monthly Trends","Quarterly Comparison","Year-over-Year Growth","Business Mileage","Home Office Expenses","Professional Services","Equipment & Supplies"],n=[{value:"manual",label:"Manual"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"quarterly",label:"Quarterly"}],c=i=>{g(E=>E.includes(i)?E.filter(N=>N!==i):[...E,i])},o=async()=>
31{if(!(!u||d.length===0)){C(!0);try{await f(l.id,{name:u,type:j,metrics:d,dateRange:r,schedule:a}),b(!1)}finally{C(!1)}}};return e.jsxs(Q,{open:x,onOpenChange:b,children:[e.jsx(q,{asChild:!0,children:T}),e.jsxs(V,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(G,{children:e.jsx(z,{children:"Edit Report"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Report Name"}),e.jsx(Z,{value:u,onChange:i=>R(i.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Report Type"}),e.jsxs(k,{value:j,onValueChange:S,children:[e.jsx($,{children:e.jsx(I,{})}),e.jsx(M,{children:t.map(i=>e.jsx(v,{value:i,children:i},i))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Date Range"}),e.jsxs(k,{value:r,onValueChange:D,children:[e.jsx($,{children:e.jsx(I,{})}),e.jsxs(M,{children:[e.jsx(v,{value:"last-30-days",children:"Last 30 Days"}),e.jsx(v,{value:"last-quarter",children:"Last Quarter"}),e.jsx(v,{value:"last-year",children:"Last Year"}),e.jsx(v,{value:"ytd",children:"Year to Date"}),e.jsx(v,{value:"custom",children:"Custom Range"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Schedule"}),e.jsxs(k,{value:a,onValueChange:y,children:[e.jsx($,{children:e.jsx(I,{})}),e.jsx(M,{children:n.map(i=>e.jsx(v,{value:i.value,children:i.label},i.value))})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-3 block",children:"Metrics to Include"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2 max-h-40 overflow-y-auto",children:s.map(i=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(J,{id:`edit-${i}`,checked:d.includes(i),onCheckedChange:()=>c(i)}),e.jsx("label",{htmlFor:`edit-${i}`,className:"text-sm",children:i})]},i))})]}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[e.jsx(w,{onClick:o,disabled:!u||d.length===0||p,children:p?"Saving...":"Save Changes"}),e.jsx(w,{variant:"outline",onClick:()=>b(!1),children:"Cancel"})]})]})]})]})}function he({reports:l,onRunReport:f,onExportReport:T,onUpdateReport:x,onDeleteReport:b,isLoading:u=!1}){const[R,j]=m.useState(new Set),[S,d]=m.useState(new Set),g=async a=>{j(y=>new Set(y).add(a.id));try{await f(a.id)}finally{j(y=>{const p=new Set(y);return p.delete(a.id),p})}},r=async(a,y)=>{d(p=>new Set(p).add(a.id));try{await T(a.id,y)}finally{d(p=>{const C=new Set(p);return C.delete(a.id),C})}},D=async a=>{window.confirm(`Are you sure you want to delete "${a.name}"?`)&&await b(a.id)};return u?e.jsxs(L,{children:[e.jsxs(O,{children:[e.jsxs(A,{className:"flex items-center gap-2",children:[e.jsx(W,{className:"h-5 w-5"}),"Saved Reports"]}),e.jsx(U,{children:"Loading your custom reports..."})]}),e.jsx(B,{children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(F,{className:"h-8 w-8 animate-spin"})})})]}):e.jsxs(L,{children:[e.jsxs(O,{children:[e.jsxs(A,{className:"flex items-center gap-2",children:[e.jsx(W,{className:"h-5 w-5"}),"Saved Reports"]}),e.jsx(U,{children:"Manage your custom reports and schedules"})]}),e.jsx(B,{children:e.jsx("div",{className:"space-y-4",children:l.map(a=>{var y,p,C;return e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",children:a.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.type}),a.data&&e.jsx("p",{className:"text-xs text-green-600 mt-1",children:"✓ Contains live data from your transactions"})]}),e.jsx(H,{variant:"outline",children:a.schedule})]}),e.jsx("div",{className:"text-sm text-muted-foreground mb-3",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(se,{className:"h-4 w-4"}),"Last run: ",a.lastRun]}),e.jsxs("span",{children:[a.metrics.length," metrics"]})]})}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>g(a),disabled:R.has(a.id),children:[R.has(a.id)?e.jsx(F,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(re,{className:"h-4 w-4 mr-1"}),R.has(a.id)?"Running...":"Run"]}),e.jsxs(Q,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(w,{variant:"outline",size:"sm",children:[e.jsx(ie,{className:"h-4 w-4 mr-1"}),"View"]}
31)}),e.jsxs(V,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[e.jsx(G,{children:e.jsxs(z,{children:[a.name," - Report Data"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Report Details"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Type:"})," ",a.type]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Schedule:"})," ",a.schedule]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Date Range:"})," ",a.dateRange]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Last Run:"})," ",a.lastRun]})]})]}),((y=a.data)==null?void 0:y.metrics)&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Financial Metrics"}),e.jsx("div",{className:"grid grid-cols-2 gap-4 text-sm",children:Object.entries(a.data.metrics).map(([t,s])=>e.jsxs("div",{className:"bg-gray-50 p-2 rounded",children:[e.jsxs("span",{className:"font-medium",children:[t,":"]})," ",s]},t))})]}),((p=a.data)==null?void 0:p.monthlyData)&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Monthly Breakdown"}),e.jsx("div",{className:"max-h-60 overflow-y-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-2 text-left",children:"Month"}),e.jsx("th",{className:"p-2 text-right",children:"Income"}),e.jsx("th",{className:"p-2 text-right",children:"Expenses"}),e.jsx("th",{className:"p-2 text-right",children:"Profit"})]})}),e.jsx("tbody",{children:a.data.monthlyData.map((t,s)=>e.jsxs("tr",{className:"border-t",children:[e.jsx("td",{className:"p-2",children:t.month}),e.jsx("td",{className:"p-2 text-right",children:e.jsx(P,{amount:t.income,fromCurrency:"USD"})}),e.jsx("td",{className:"p-2 text-right",children:e.jsx(P,{amount:t.expenses,fromCurrency:"USD"})}),e.jsx("td",{className:`p-2 text-right ${t.profit>=0?"text-green-600":"text-red-600"}`,children:e.jsx(P,{amount:t.profit,type:t.profit>=0?"income":"expense",fromCurrency:"USD"})})]},s))})]})})]}),((C=a.data)==null?void 0:C.categoryData)&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Expense Categories"}),e.jsx("div",{className:"max-h-40 overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:a.data.categoryData.map((t,s)=>e.jsxs("div",{className:"flex justify-between items-center bg-gray-50 p-2 rounded",children:[e.jsx("span",{children:t.name}),e.jsx("span",{className:"font-medium",children:e.jsx(P,{amount:t.value,fromCurrency:"USD"})})]},s))})})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Included Metrics"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:a.metrics.map(t=>e.jsx(H,{variant:"secondary",children:t},t))})]})]})]})]}),e.jsxs(Q,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(w,{variant:"outline",size:"sm",disabled:S.has(a.id),children:[S.has(a.id)?e.jsx(F,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(ae,{className:"h-4 w-4 mr-1"}),"Export"]})}),e.jsxs(V,{children:[e.jsx(G,{children:e.jsx(z,{children:"Export Report"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:['Choose the format to export "',a.name,'" with live data']}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{onClick:()=>r(a,"pdf"),children:"Export as Text"}),e.jsx(w,{onClick:()=>r(a,"csv"),children:"Export as CSV"}),e.jsx(w,{onClick:()=>r(a,"xlsx"),children:"Export as Excel"})]})]})]})]}),e.jsx(me,{report:a,onSave:x,trigger:e.jsxs(w,{variant:"outline",size:"sm",children:[e.jsx(X,{className:"h-4 w-4 mr-1"}),"Edit"]})}),e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>D(a),className:"text-destructive hover:text-destructive",children:[e.jsx(ce,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]},a.id)})})})]})}function xe(){const{savedReports:l,createReport:f,updateReport:T,deleteReport:x,runReport:b,exportReport:u,isLoading:R}=oe(),j=async r=>{await f(r)},S=async r=>{await b(r)},d=async r=>{await f({name:r.name,type:r.type,metrics:r.metrics,dateRange:r.dateRange,schedule:r.schedule||"manual"})},g=[{name:"Freelancer Tax Summary",type:"Tax Projection",description:"Track income, expenses, and deductions for freelance work",metrics:["Total Income","Total Expenses","Tax Deductions","Net Profit"],dateRange:"ytd",schedule:"monthly"},{name:"Small Business Dashboard",type:"Business Performance",description:"Comprehensive business performance and tax metrics",metrics:["Total Income","Total Expenses","Monthly Trends","Quarterly Comparison"],dateRange:"last-year",schedule:"weekly"},{name:"Investment Portfolio Report",type:"Investment Analysis",description:"Track capital gains, losses, and investment income",metrics:["Total Income","Income Sources","Year-over-Year Growth"],dateRange:"last-quarter",schedule:"quarterly"},{name:"Rental Property Analysis",type:"Income Tracking",description:"Monitor rental income, expenses, and depreciation",metrics:["Total Income","Total Expenses","Expense by Category","Net Profit"],dateRange:"last-year",schedule:"monthly"}];return e.jsx(ne,{feature:te.CustomReports,children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Custom Reports & Insights"}),e.jsx("p",{className:"text-muted-foreground",children:"Create personalized reports with real data from your transactions"})]}),e.jsx(H,{variant:"outline",className:"bg-purple-50 text-purple-700 border-purple-300",children:"Enterprise Feature"})]}),e.jsx(de,{onCreateReport:j}),e.jsx(he,{reports:l,onRunReport:S,onExportReport:u,onUpdateReport:T,onDeleteReport:x,isLoading:R}),e.jsxs(L,{children:[e.jsxs(O,{children:[e.jsx(A,{children:"Popular Report Templates"}
31),e.jsx(U,{children:"Quick-start templates for common reporting needs with live data"})]}),e.jsx(B,{children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:g.map((r,D)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:r.name}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r.description}),e.jsx("div",{className:"mb-3",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Includes: ",r.metrics.join(", ")]})}),e.jsx(w,{variant:"outline",size:"sm",onClick:()=>d(r),children:"Use Template"})]},D))})})]})]})})}const Be=()=>e.jsx("div",{className:"container mx-auto px-4 py-8",children:e.jsx(xe,{})});export{Be 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.