import{aY as n,aJ as s}from"./@ui-core-DKdciH1Z.js";import{e as l,ai as c,B as m,s as d}from"./index-D7KLAbvI.js";import{f as p}from"./index-DPr7bdjs.js";import{C as u}from"./ComponentIcon-BOKrWHiD.js";function y({type:i,setSelectedFlavor:e}){const t=n(p.flavorListInfinite({type:i}));if(t.isPending)return s.jsx(g,{});if(t.isError)return s.jsx("p",{children:"Failed to fetch Flavor List"});const{data:r}=t;return s.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-4",children:r.pages.map(o=>o.items.map(a=>s.jsx("li",{className:"",children:s.jsx(x,{type:i,onClick:()=>e(a),id:a.id,name:a.name,displayName:a.body?.display_name??void 0,logoUrl:a.body?.logo_url??void 0})},a.id)))})}function x({name:i,logoUrl:e,onClick:t,type:r,displayName:o}){const a=o??c(i);return s.jsxs(m,{onClick:t,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:d(e)}):s.jsx(u,{className:"aspect-square h-[36px] w-[36px] fill-primary-400 object-contain",type:r}),s.jsx("span",{className:"min-w-0 truncate",children:a})]})}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};
