import{jsxs as a,jsx as e}from"react/jsx-runtime";import{I as h}from"./input-qMvM9qch.js";import{B as i}from"./button-BvFBRYHq.js";import{S as u,a as f,b as S,c as v,f as o}from"./select-DfhewM4T.js";import{Loader2 as g,List as w}from"lucide-react";import{router as x}from"@inertiajs/react";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-slot";import"class-variance-authority";import"@radix-ui/react-select";function q({searchQuery:l,searchType:t,showAll:m,loadingAll:n,onSearchQueryChange:c,onSearchTypeChange:s,onLoadAllFactions:p,onClearShowAll:d}){return a("div",{className:"flex items-center py-4 gap-2 flex-wrap",children:[a("form",{onSubmit:r=>{r.preventDefault(),x.visit(route("admin.manage-factions",{search:l,type:t}))},className:"flex gap-2 w-full max-w-lg",children:[a(u,{value:t,onValueChange:s,children:[e(f,{className:"w-[140px]",children:e(S,{placeholder:"Search by"})}),a(v,{children:[e(o,{value:"id",children:"ID"}),e(o,{value:"name",children:"Name"})]})]}),e(h,{placeholder:t==="id"?"Enter Faction ID...":"Enter Faction Name...",value:l,onChange:r=>c(r.target.value),className:"w-full"}),e(i,{type:"submit",variant:"secondary",children:"Search"})]}),a(i,{variant:"outline",onClick:p,disabled:n,children:[n?e(g,{className:"h-4 w-4 mr-2 animate-spin"}):e(w,{className:"h-4 w-4 mr-2"}),"Show All Factions"]}),m&&e(i,{variant:"ghost",onClick:d,children:"Clear"})]})}export{q as SearchBar};
