import{j as e,t as v,u as w,r as i,aq as y,e as D}from"./vendor-rThclpOQ.js";import{u}from"./use-lang-BK6P2WMc.js";import{d as P}from"./debounce-CWHP_ANh.js";import{g as S}from"./route-B4ZMN77y.js";import{c as T}from"./utils-8KAaAB9H.js";import{B as E}from"./button-ZcsoqUQn.js";import{D as z,a as M,b as C,c as R}from"./dropdown-menu-Cm0H42C1.js";import{S as q}from"./scroll-area-BCwyUKIK.js";import{T as B}from"./table-page-size-FBmivxVb.js";const I=r=>{const{className:s}=r,{table:t}=u(),a=()=>{};return e.jsx("div",{className:`relative ml-3 ${s}`,children:e.jsxs(z,{children:[e.jsx(M,{children:e.jsx(E,{size:"icon",variant:"secondary",className:"group h-10 w-11 rounded-md border border-gray-200 p-0 hover:border-blue-500",children:e.jsx(v,{className:"h-4 w-4 text-gray-700 group-hover:text-blue-500"})})}),e.jsx(C,{align:"end",children:e.jsx(q,{className:"max-h-[198px]",children:e.jsx(R,{onClick:a,className:"text-center",children:t.csv})})})]})})},J=r=>{const{Icon:s,data:t,title:a,component:l,globalSearch:p,tablePageSizes:x,routeName:o,routeParams:m,exportPath:d,className:f}=r,{common:h}=u(),g=w(),n=S(g.url),c=i.useRef(null),b=P(async j=>{const N=j.target.value;D.get(route(o||"",{...m||{},...n,search:N}),{},{preserveState:!0,preserveScroll:!0,showProgress:!1})},300);return i.useEffect(()=>{n.search&&c.current&&c.current.focus()},[r]),e.jsxs("div",{className:T("items-center justify-between p-6 md:flex",f),children:[e.jsxs("div",{className:"flex items-center gap-5",children:[s&&e.jsx("div",{className:"bg-primary-25 flex h-10 w-10 items-center justify-center rounded-md",children:s}),a&&e.jsx("p",{className:"mb-4 text-lg font-semibold md:mb-0",children:a})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[p&&e.jsxs("div",{className:"relative w-full md:max-w-[260px]",children:[e.jsx("input",{type:"text",ref:c,placeholder:h.search,onChange:b,className:"focus:border-primary border-border h-10 w-full rounded-md border py-[15px] pr-4 pl-12 text-sm font-normal focus:ring-0 focus:outline-0",defaultValue:n.search??""}),e.jsx(y,{className:"text-muted-foreground absolute top-1/2 left-4 z-10 h-4 w-4 -translate-y-1/2"})]}),o&&e.jsx(B,{routeParams:m,routeName:o,pageData:t,dropdownList:x}),d&&e.jsx(I,{route:d}),l&&l]})]})};export{J as T};
