import { render_slot_items } from '../RsvSlotItems.js'; export function reservation_summary_renderer(symbols) { const slots = symbols.slots ?? []; const pricing = symbols.pricing ?? {}; if (!Array.isArray(slots) || slots.length === 0) { return ''; } const s = ReservairStrings.summary; const locale = navigator.language; const currency = pricing.currency ?? s.currency; const items = render_slot_items(slots, locale, currency); const itemsHtml = items.map(li => li.outerHTML).join(''); const footerRows = []; const subtotal = pricing.subtotal ?? 0; footerRows.push(` `); if (pricing.discount && pricing.discount.percent > 0) { const amount = pricing.discount.amount ?? 0; const reason = pricing.discount.reason ?? ''; footerRows.push(` `); } const total = pricing.total ?? 0; footerRows.push(` `); return `
${s.title}
`; }