Ship youre-commerce sitein just a few clicks
Spin up a new project, or connect an existing, and explore rollbacks, CI/CD, edge functions, collaborative deploy previews, and more.
exportfunctionCartMain({layout,cart}:CartMainProps) {
constlinesCount=Boolean(cart?.lines?.nodes?.length||0);
constwithDiscount=
cart&&
Boolean(cart.discountCodes.filter((code)=>code.applicable).length);
constclassName=`cart-main${withDiscount?'with-discount':''}`;
return(
<divclassName={className}>
<CartEmptyhidden={linesCount}layout={layout}/>
<CartDetailscart={cart}layout={layout}/>
</div>
);
}
conststream=awaitgetChatStream(
{
...appConfig.apiConfig,
user:context.ip,
messages:[{ role:"system",content:prompt },...messages],
},
appConfig.OPENAI_API_KEY??""
);
returnnewResponse(stream, {
headers:{"Content-Type":"text/plain"},
});
---
consthomepage=awaitgetEntryBySlug("homepage","index");
const{ banner, key_features, service, testimonial }=homepage.data;
---
<Base>
<Bannerbanner={banner}/>
<KeyFeatureskey_features={key_features}/>
<Serviceservice={service}/>
<Testimonialtestimonial={testimonial}/>
<Cta/>
</Base>
importtype{ Config, Context }from"@netlify/edge-functions";
exportdefaultasync(request:Request,context:Context)=>{
returnResponse.json({ geo:context.geo });
};
exportconstconfig:Config={
path:"/geolocation",
};