Kolejne zmiany,
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user