import{j as s}from"./@radix-AvWw-1nd.js";import{f as o,_ as c,ae as m,S as d}from"./index-DWoLoYDY.js";import{f as u}from"./index-Bjeu4_0O.js";import{h as p}from"./@tanstack-CcI3lvwB.js";function N({type:e,setSelectedFlavor:i}){const a=p(u.flavorListInfinite({type:e}));if(a.isPending)return s.jsx(f,{});if(a.isError)return s.jsx("p",{children:"Failed to fetch Flavor List"});const{data:l}=a;return s.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-4",children:l.pages.map(n=>n.items.map(r=>{var t;return s.jsx("li",{className:"",children:s.jsx(g,{onClick:()=>i(r),id:r.id,name:r.name,logoUrl:((t=r.body)==null?void 0:t.logo_url)??void 0})},r.id)}))})}function g({name:e,logoUrl:i,onClick:a}){return s.jsxs(o,{onClick:a,intent:"secondary",emphasis:"subtle",className:"h-auto w-full gap-2 px-5 py-3",children:[i&&s.jsx("img",{alt:`Logo of ${e}`,width:36,height:36,className:"aspect-square object-contain",src:c(i)}),s.jsx("span",{className:"min-w-0 truncate",children:m(e)})]})}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((e,i)=>s.jsx(d,{className:"h-[70px] w-full"},i))})}export{N as S};
