import{j as s}from"./@radix-C7hRs6Kx.js";import{S as l,h as c,Z as m,ac as d}from"./index-D2iSHVZq.js";import{f as p}from"./index-CmLcvK2z.js";import{h as u}from"./@tanstack-CSxjHCME.js";import{C as x}from"./ComponentIcon-ils7uNAk.js";function y({type:i,setSelectedFlavor:e}){const a=u(p.flavorListInfinite({type:i}));if(a.isPending)return s.jsx(g,{});if(a.isError)return s.jsx("p",{children:"Failed to fetch Flavor List"});const{data:t}=a;return s.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-4",children:t.pages.map(n=>n.items.map(r=>{var o;return s.jsx("li",{className:"",children:s.jsx(f,{type:i,onClick:()=>e(r),id:r.id,name:r.name,logoUrl:((o=r.body)==null?void 0:o.logo_url)??void 0})},r.id)}))})}function f({name:i,logoUrl:e,onClick:a,type:t}){return s.jsxs(c,{onClick:a,intent:"secondary",emphasis:"subtle",className:"h-auto w-full gap-2 px-5 py-3",children:[e?s.jsx("img",{alt:`Logo of ${i}`,width:36,height:36,className:"aspect-square object-contain",src:m(e)}):s.jsx(x,{className:"aspect-square h-[36px] w-[36px] fill-primary-400 object-contain",type:t}),s.jsx("span",{className:"min-w-0 truncate",children:d(i)})]})}function g(){return s.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-4",children:Array.from({length:4}).map((i,e)=>s.jsx(l,{className:"h-[70px] w-full"},e))})}export{y as S};
