Kolejne zmiany,

This commit is contained in:
dm
2025-12-15 11:28:53 +01:00
parent c0b9d5a584
commit 6b5a913666
48 changed files with 1630 additions and 868 deletions

View File

@@ -30,7 +30,8 @@ function mapCardToPlan(card, match, labels, waluta) {
features.push({ label: "Umowa", value: labels?.umowa || "—" });
features.push({
label: "Aktywacja",
value: typeof match?.aktywacja === "number" ? formatMoney(match.aktywacja, waluta) : "—",
value:
typeof match?.aktywacja === "number" ? formatMoney(match.aktywacja, waluta) : "—",
});
return {
@@ -50,7 +51,8 @@ function mapCardToPlan(card, match, labels, waluta) {
* cenaOpis?: string,
* phoneCards?: any[],
* addons?: any[],
* addonsCenaOpis?: string
* addonsCenaOpis?: string,
* switches?: any[] // ✅ NOWE: przełączniki z YAML
* }} props
*/
export default function InternetCards({
@@ -62,10 +64,11 @@ export default function InternetCards({
phoneCards = [],
addons = [],
addonsCenaOpis = "zł/mies.",
switches = [], // ✅ NOWE
}) {
const visibleCards = Array.isArray(cards) ? cards : [];
// switch state (z /api/switches)
// switch state (teraz idzie z OffersSwitches na podstawie YAML)
const [selected, setSelected] = useState({});
const [labels, setLabels] = useState({});
@@ -100,7 +103,8 @@ export default function InternetCards({
</div>
)}
<OffersSwitches />
{/* ✅ TERAZ switcher dostaje dane z YAML */}
<OffersSwitches switches={switches} />
{visibleCards.length === 0 ? (
<p class="opacity-80">Brak dostępnych pakietów.</p>