diff --git a/src/content/internet-telewizja/tv-addons.yaml b/src/content/internet-telewizja/tv-addons.yaml index daf9b81..f031f87 100644 --- a/src/content/internet-telewizja/tv-addons.yaml +++ b/src/content/internet-telewizja/tv-addons.yaml @@ -24,8 +24,10 @@ dodatki: - Bogaty 12m: 24.99 bezterminowo: 28.99 + - id: canal_super_sport nazwa: CANAL+ Super Sport + tid: 48 typ: checkbox opis: Pakiet sportowy Canal+. cena: @@ -38,9 +40,10 @@ dodatki: - Bogaty 12m: 64.99 bezterminowo: 68.99 - tid: 48 + - id: cinemax nazwa: Cinemax + tid: 18 typ: checkbox opis: Kanały Cinemax. cena: @@ -55,9 +58,9 @@ dodatki: - Optimum - Platinum bezterminowo: 14.9 - tid: 18 - id: eleven nazwa: Eleven + tid: 61 typ: checkbox opis: Kanały Eleven Sports. cena: @@ -67,9 +70,10 @@ dodatki: - Bogaty 12m: 15 bezterminowo: 25 - tid: 61 + - id: filmbox nazwa: FilmBox+ + tid: 19 typ: checkbox opis: Kanały FilmBox. cena: @@ -79,10 +83,13 @@ dodatki: - Bogaty 12m: 10 bezterminowo: 15 - tid: 19 + - id: hbo_max_podstawowy nazwa: HBO + Max Podstawowy + tid: 20 typ: checkbox + group: hbo_max + group_mode: single opis: | W ramach Pakietu Podstawowego HBO Max możesz oglądać filmy i seriale w jakości FullHD na dwóch urządzeniach jednocześnie. Pakiet Podstawowy HBO Max to również dostęp do bogatej Biblioteki TVN oraz możliwość śledzenia kanału live TVN. @@ -97,10 +104,13 @@ dodatki: - Bogaty 12m: 27.99 bezterminowo: 29.99 - tid: 20 + - id: hbo_max_standardowy nazwa: HBO + Max Standardowy + tid: 96 typ: checkbox + group: hbo_max + group_mode: single opis: HBO + Max (wariant standardowy). cena: - pakiety: @@ -112,10 +122,13 @@ dodatki: - Bogaty 12m: 36.99 bezterminowo: 39.99 - tid: 96 + - id: hbo_max_premium nazwa: HBO + Max Premium + tid: 97 typ: checkbox + group: hbo_max + group_mode: single opis: HBO + Max (wariant premium). cena: - pakiety: @@ -127,9 +140,10 @@ dodatki: - Bogaty 12m: 44.99 bezterminowo: 49.99 - tid: 97 + - id: wiecej_sportu_plus nazwa: Więcej Sportu Plus + tid: 79 typ: checkbox opis: Dodatkowy pakiet sportowy. cena: @@ -139,9 +153,10 @@ dodatki: - Bogaty 12m: 15 bezterminowo: 25 - tid: 79 + - id: wiecej_erotyki nazwa: Więcej Erotyki + tid: 80 typ: checkbox opis: Pakiet kanałów erotycznych. cena: @@ -151,10 +166,12 @@ dodatki: - Bogaty 12m: 15 bezterminowo: 25 - tid: 80 - - id: disney_standard + + - id: _standard nazwa: Disney+ Standard typ: checkbox + group: disney + group_mode: single tid: 10001 opis: | Historie na całe życie czekają. Odkryj hity filmowe, nowe seriale i produkcje oryginalne ze świata Disneya, Pixara, Gwiezdnych wojen, Marvela, a także produkcje Hulu, National Geographic i FX. @@ -178,9 +195,12 @@ dodatki: - Korzystny - Bogaty bezterminowo: 34.99 + - id: disney_premium nazwa: Disney+ Premium typ: checkbox + group: disney + group_mode: single tid: 10002 opis: | Historie na całe życie czekają. Odkryj hity filmowe, nowe seriale i produkcje oryginalne ze świata Disneya, Pixara, Gwiezdnych wojen, Marvela, a także produkcje Hulu, National Geographic i FX. diff --git a/src/islands/Internet/InternetAddonsModal.jsx b/src/islands/Internet/InternetAddonsModal.jsx index 4f991f0..4782641 100644 --- a/src/islands/Internet/InternetAddonsModal.jsx +++ b/src/islands/Internet/InternetAddonsModal.jsx @@ -17,10 +17,8 @@ export default function InternetAddonsModal({ isOpen, onClose, plan, - phoneCards = [], addons = [], - cenaOpis = "zł / mies.", }) { const phonePlans = useMemo(() => mapPhoneYamlToPlans(phoneCards), [phoneCards]); diff --git a/src/islands/Internet/InternetCards.jsx b/src/islands/Internet/InternetCards.jsx index 1477a73..103d100 100644 --- a/src/islands/Internet/InternetCards.jsx +++ b/src/islands/Internet/InternetCards.jsx @@ -8,7 +8,7 @@ function formatMoney(amount, currency = "PLN") { if (typeof amount !== "number" || Number.isNaN(amount)) return ""; try { return new Intl.NumberFormat("pl-PL", { - style: "currency", + style: "", currency, maximumFractionDigits: 0, }).format(amount); diff --git a/src/islands/modals/sections/TvAddonsSection.jsx b/src/islands/modals/sections/TvAddonsSection.jsx index 08269bf..b27a08b 100644 --- a/src/islands/modals/sections/TvAddonsSection.jsx +++ b/src/islands/modals/sections/TvAddonsSection.jsx @@ -14,10 +14,26 @@ export default function TvAddonsSection({ setTvTerm, tvAddonsPrice, }) { - const toggleCheckboxAddon = (id) => { + + const toggleCheckboxAddon = (addon) => { setSelectedQty((prev) => { const next = { ...prev }; - next[id] = (next[id] || 0) > 0 ? 0 : 1; + + const isOn = (next[addon.id] || 0) > 0; + const willTurnOn = !isOn; + + // ✅ jeśli grupa "single" i włączamy -> wyłącz inne z tej grupy + if (willTurnOn && addon.group && addon.group_mode === "single") { + for (const a of tvAddonsVisible) { + if (a.id !== addon.id && a.group === addon.group) { + next[a.id] = 0; + } + } + } + + // toggle bieżącego + next[addon.id] = willTurnOn ? 1 : 0; + return next; }); }; @@ -37,66 +53,66 @@ export default function TvAddonsSection({ if (!isQty) { return ( -