import{t as e}from"./jsx-runtime-B-hcVAMW.js";import{a as t,g as n,t as r}from"./api-Duu96wkE.js";var i=e();function a({meta:e,category:t,onCategoryChange:n,search:r,onSearchChange:a,peopleOnly:o,onPeopleOnlyChange:s}){return(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[a&&(0,i.jsx)(`input`,{type:`search`,value:r??``,placeholder:`Search activity`,"aria-label":`Search activity`,onChange:e=>a(e.target.value),className:`w-full max-w-xs rounded-lg border-0 px-3 py-2 text-sm ring-1 ring-inset ring-slate-300 focus:ring-2 focus:ring-brand-600`}),(0,i.jsxs)(`select`,{value:t,"aria-label":`Filter by category`,onChange:e=>n(e.target.value),className:`rounded-lg border-0 py-2 pl-3 pr-8 text-sm ring-1 ring-inset ring-slate-300 focus:ring-2 focus:ring-brand-600`,children:[(0,i.jsx)(`option`,{value:``,children:`All activity`}),(e?.categories??[]).map(e=>(0,i.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),s&&(0,i.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-slate-600`,children:[(0,i.jsx)(`input`,{type:`checkbox`,checked:o??!1,onChange:e=>s(e.target.checked),className:`size-4 rounded border-slate-300 text-brand-600 focus:ring-brand-600`}),`Hide system events`]})]})}var o={feed:e=>[`activities`,`feed`,e],forApplicant:(e,t)=>[`applicants`,e,`activities`,t]};async function s(e,t){let n=await r.get(e,{params:t});return{activities:n.data.data,meta:n.data.meta}}function c(e){return t({queryKey:o.feed(e),queryFn:()=>s(`/activities`,e),placeholderData:n})}function l(e,r={}){return t({queryKey:o.forApplicant(e??``,r),queryFn:()=>s(`/applicants/${e}/activities`,r),enabled:!!e,placeholderData:n})}export{l as n,a as r,c as t};