// Ofertas — three layout variants exposed via prop:
// 'list' → editorial accordion (default)
// 'grid' → 2x2 card grid
// 'table' → dense comparison table
function Ofertas({ variant = 'list' }) {
const [lang] = useLang();
const [region, setRegion] = React.useState('latam'); // latam | us
const [open, setOpen] = React.useState('diagnostico');
const C = window.FUSE_CONTENT.ofertas;
const items = C.items;
const [pre, emph, post] = C.h2[lang];
const RegionToggle = ({ darkChrome = false }) => (
setRegion('latam')} aria-pressed={region === 'latam'}>{C.pricing_toggle_label[lang][0]}
setRegion('us')} aria-pressed={region === 'us'}>{C.pricing_toggle_label[lang][1]}
);
return (
{variant === 'list' && (
)}
{variant === 'grid' &&
}
{variant === 'table' &&
}
{lang === 'es'
? 'En la mayoría de los casos, el diagnóstico conduce naturalmente a una implementación. No es necesario — pero suele ser la mejor entrada.'
: 'In most cases, the diagnostic naturally leads into an implementation. Not required — but usually the best entry point.'}
);
}
function ListVariant({ items, lang, region, open, setOpen }) {
return (
{items.map((o, i) => {
const isOpen = open === o.id;
return (
setOpen(isOpen ? null : o.id)}
role="button"
aria-expanded={isOpen}
>
{o.num}
{o.title[lang]}
§ {o.type[lang]}
{o.summary[lang]}
{o.price[region]}
{region === 'latam' ? 'Latam' : 'US'}
+
{isOpen && (
e.stopPropagation()}>
{lang === 'es' ? 'Duración' : 'Duration'}
{o.duration[lang]}
{lang === 'es' ? 'Precio' : 'Price'}
{o.price[region]}
{region === 'latam' ? 'Latam' : 'United States'}
{lang === 'es' ? 'Entregables' : 'Deliverables'}
{o.deliverables[lang].map((d, j) => {d} )}
)}
);
})}
);
}
function GridVariant({ items, lang, region }) {
return (
{items.map((o, i) => (
{o.title[lang]}
{o.duration[lang]}
{o.summary[lang]}
{o.deliverables[lang].slice(0, 3).map((d, j) => (
→
{d}
))}
{o.deliverables[lang].length > 3 && (
+ {o.deliverables[lang].length - 3} {lang === 'es' ? 'entregables más' : 'more deliverables'}
)}
{region === 'latam' ? 'Latam' : 'US'}
{o.price[region]}
))}
);
}
function TableVariant({ items, lang, region }) {
return (
{lang === 'es' ? 'Oferta' : 'Offering'}
{lang === 'es' ? 'Tipo' : 'Type'}
{lang === 'es' ? 'Duración' : 'Duration'}
{lang === 'es' ? 'Precio' : 'Price'}
{items.map((o, i) => (
{o.num}
{o.title[lang]}
{o.summary[lang]}
{o.type[lang]}
{o.duration[lang]}
{o.price[region]}
))}
);
}
window.Ofertas = Ofertas;
window.ListVariant = ListVariant;
window.GridVariant = GridVariant;
window.TableVariant = TableVariant;