import{U as p,r as u,K as N,j as e,L as w}from"./app-D_lWdAF1.js";import{A as y,T as G}from"./alert-box-CSO11xje.js";import{B as f,A as W}from"./Add-B_lToW0R.js";import{G as n}from"./grid-view-DFp2PvPX.js";import{_ as k,a as z,A as L}from"./app-layout-DBWaGSby.js";import{u as S,a as V,B as $,o as F,P as t}from"./ButtonGroupContext-Cgw_Lntq.js";import"./app-gFGt7Tbg.js";import"./app-logo-icon-B18IWF-o.js";import"./slots-DhmpWYGS.js";import"./Typography-D06EX7-K.js";import"./index--DsFJTFe.js";import"./index-DKsctv8k.js";var I=["as","classPrefix","role","className","children","block","vertical","justified","size"],x=p.forwardRef(function(a,i){var c=S("ButtonGroup",a),s=c.propsWithDefaults,o=s.as,m=o===void 0?"div":o,l=s.classPrefix,h=l===void 0?"btn-group":l,r=s.role,v=r===void 0?"group":r,b=s.className,P=s.children,_=s.block,C=s.vertical,E=s.justified,d=s.size,g=k(s,I),j=V(h),B=j.withClassPrefix,D=j.merge,T=D(b,B(d,{block:_,vertical:C,justified:E})),A=u.useMemo(function(){return{size:d}},[d]);return p.createElement($.Provider,{value:A},p.createElement(m,z({},g,{role:v,ref:i,className:T}),P))});x.displayName="ButtonGroup";x.propTypes={className:t.string,as:t.elementType,classPrefix:t.string,children:t.node,block:t.bool,vertical:t.bool,justified:t.bool,role:t.string,size:F(["lg","md","sm","xs"])};const M=[{title:"Estimates",href:"#"}];function se({columns:a=[],dataset:i=[]}){const{flash:c}=N().props,[s,o]=u.useState([]),[m,l]=u.useState([]);return u.useEffect(()=>{o(a),l(i)},[a,i]),e.jsxs(L,{breadcrumbs:M,children:[e.jsx(w,{title:"Estimates"}),e.jsx(y,{flash:c}),e.jsxs(n,{title:"Estimates",children:[e.jsx(n.Title,{children:"Estimates"}),e.jsx(n.Action,{children:e.jsx(f,{href:route("estimates.create"),startIcon:e.jsx(W,{}),children:"Add"})}),e.jsx(n.Body,{children:e.jsx(G,{columns:s,dataset:m,showSelection:!0,action:!0,renderers:{action:(h,r)=>e.jsx(e.Fragment,{children:e.jsxs(x,{variant:"outlined",children:[e.jsx(f,{variant:"text",href:route("estimates.items.index",{estimate:r.estimate_id}),children:" ITEMS "}),e.jsx(f,{variant:"text",href:route("estimates.pdf",{estimate:r.estimate_id,pdf:!0}),children:" PDF "})]})})}})})]})]})}export{se as default};
