UNPKG

sate-lib

Version:

A lightweight and modular React component library designed for modern web interfaces. **SATE Lib** powers the [sate.menu](https://sate.menu) platform with reusable, scalable, and themeable UI components.

1 lines 1.3 kB
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Badge as i}from"../badge/badge.js";import{Icon as r}from"../icon/icon.js";import s from"./menu-item.styles.module.js";function l({extra:l,special:n,photo:c,name:m,description:d,badges:t,prices:o}){return a("div",{className:[s.root,n&&s.special,l&&s.extra].filter(Boolean).join(" "),children:[a("div",{className:s.content,children:[c&&e("div",{className:s.icon,children:e(r,{name:"Eye-fill",size:12})}),a("div",{className:s.header,children:[a("div",{className:s.nameWrapper,children:[l&&e(i,{label:"+Add",variant:"warning"}),e("div",{className:`bodyDefaultEmphasis ${s.name}`,children:m})]}),t&&e("div",{className:s.badges,children:t?.map((a,r)=>e(i,{...a},`badge-${a.label??a.icon??r}-${r}`))}),e("span",{className:s.dots})]}),e("div",{className:`bodySmall ${s.description}`,children:d})]}),e("div",{className:s.prices,children:o?.map(({label:i,value:r},n)=>{let c;return a("div",{className:s.priceItem,children:[!l&&i&&e("span",{className:`bodyDefault ${s.priceLabel}`,children:i}),e("span",{className:`bodyDefaultEmphasis ${s.priceValue}`,children:(c="string"==typeof r?parseFloat(r):r,new Intl.NumberFormat("en-GB",{currency:"GBP",minimumFractionDigits:2,style:"currency"}).format(c))})]},`price-${i??r}-${n}`)})})]})}export{l as MenuItem};