INNER CODE UNIT · JavaScript

Totals

CrystallizeAPI/crystallize-nextjs-boilerplate · src/components/basket/totals/index.js:10

export default function Totals(props) {
  const { t } = useTranslation(['common', 'basket']);
  const { cart, total, status } = useBasket();

  if (cart.length === 0) {
    return null;
  }

  const { currency } = total;
  function printCurrencyAmount(value) {
    return t('price', { value, currency });
  }

  const hasDiscount = total?.discount > 0;
  const isLoading = status === 'server-basket-is-stale';

  return (
    <Outer {...props}>

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…