'use client';
import{jsx as e}from"react/jsx-runtime";import{useMemo as r}from"react";import{useCartData as t,useFormatMoney as c}from"@gem-sdk/core";import u from"../../text/components/Text.js";let CartTotalPrice=({setting:l,styles:a,builderProps:o})=>{let{data:i}=t(),n=r(()=>{switch(l?.priceType){case"tax":default:return{value:i?.totalPrice,currency:i?.currency};case"duty":return{value:i?.lineItemsSubtotalPrice,currency:i?.currency};case"subtotal":return{value:i?.subtotalPrice,currency:i?.currency}}},[i?.currency,i?.lineItemsSubtotalPrice,i?.subtotalPrice,i?.totalPrice,l?.priceType]),s=c(n.value||0,!1);return n?e(u,{builderProps:o,styles:a,setting:{text:s,excludeFlex:!0}}):null};export{CartTotalPrice as default};
