--- import DefaultLayout from "../../layouts/DefaultLayout.astro"; import SectionRenderer from "../../components/sections/SectionRenderer.astro"; import InternetCards from "../../islands/Internet/InternetCards.jsx"; import { loadYaml, safeArray } from "../../lib/astro-helpers"; import NoteAccordion from "../../components/ui/NoteAccordion.astro"; type InternetParam = { klucz: string; label: string; value: string | number }; type InternetCena = { budynek: number | string; umowa: number | string; miesiecznie: number; aktywacja?: number; }; type InternetCard = { nazwa: string; widoczny?: boolean; popularny?: boolean; parametry?: InternetParam[]; ceny?: InternetCena[]; }; type InternetCardsYaml = { tytul?: string; opis?: string; uwaga?: string; waluta?: string; cena_opis?: string; cards?: InternetCard[]; }; type PhoneParam = { klucz: string; label: string; value: string | number }; type PhoneCard = { nazwa: string; widoczny?: boolean; popularny?: boolean; cena?: { wartosc: number; opis?: string }; parametry?: PhoneParam[]; }; type PhoneCardsYaml = { cards?: PhoneCard[] }; type Addon = { id: string; nazwa: string; typ?: string; ilosc?: boolean; min?: number; max?: number; krok?: number; opis?: string; cena: number; }; type AddonsYaml = { cena_opis?: string; dodatki?: Addon[] }; type SwitchOption = { id: string | number; nazwa: string }; type SwitchDef = { id: string; etykieta?: string; title?: string; domyslny?: string | number; opcje: SwitchOption[]; }; type SwitchesYaml = { switches?: SwitchDef[] }; const seo = loadYaml("./src/content/internet-swiatlowodowy/seo.yaml"); const data = loadYaml( "./src/content/internet-swiatlowodowy/cards.yaml", ); const phoneData = loadYaml("./src/content/telefon/cards.yaml"); const addonsData = loadYaml( "./src/content/internet-swiatlowodowy/addons.yaml", ); const switchesData = loadYaml("./src/content/site/switches.yaml"); const tytul = data?.tytul ?? ""; const opis = data?.opis ?? "Wybierz rodzaj budynku i czas trwania umowy"; const uwaga = data?.uwaga ?? ""; const waluta = data?.waluta ?? "PLN"; const cenaOpis = data?.cena_opis ?? "zł/mies."; const cards = safeArray(data?.cards).filter( (c) => c?.widoczny === true, ); const phoneCards = safeArray(phoneData?.cards).filter( (c) => c?.widoczny === true, ); const addons = safeArray(addonsData?.dodatki); const switches = safeArray(switchesData?.switches); const addonsCenaOpis = addonsData?.cena_opis ?? cenaOpis; ---