import{j as s}from"./@radix-D8tIKeo-.js";import{e as n,B as l,s as c,aI as m}from"./index-rPJfPIfq.js";import{f as d}from"./index-C3cgrIY_.js";import{k as p}from"./@tanstack-nMqraTcu.js";import{C as u}from"./ComponentIcon-D_yr1vNI.js";function k({type:i,setSelectedFlavor:e}){const a=p(d.flavorListInfinite({type:i}));if(a.isPending)return s.jsx(f,{});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(o=>o.items.map(r=>s.jsx("li",{className:"",children:s.jsx(x,{type:i,onClick:()=>e(r),id:r.id,name:r.name,logoUrl:r.body?.logo_url??void 0})},r.id)))})}function x({name:i,logoUrl:e,onClick:a,type:t}){return s.jsxs(l,{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:c(e)}):s.jsx(u,{className:"aspect-square h-[36px] w-[36px] fill-primary-400 object-contain",type:t}),s.jsx("span",{className:"min-w-0 truncate",children:m(i)})]})}function f(){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(n,{className:"h-[70px] w-full"},e))})}export{k as S};
