diff --git a/src/pages/internet-swiatlowodowy/index.astro b/src/pages/internet-swiatlowodowy/index.astro index ff9980f..3e097b3 100644 --- a/src/pages/internet-swiatlowodowy/index.astro +++ b/src/pages/internet-swiatlowodowy/index.astro @@ -15,17 +15,16 @@ type InternetCard = { nazwa: string; widoczny?: boolean; popularny?: boolean; pa type InternetCardsYaml = { tytul?: string; opis?: string; + uwaga?: string; waluta?: string; cena_opis?: string; cards?: InternetCard[]; }; -// TELEFON YAML (twój format) 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[] }; -// ADDONS YAML (twój format) 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[] }; @@ -47,23 +46,23 @@ const addonsData = loadYamlFile( 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: InternetCard[] = Array.isArray(data?.cards) +const cards = (Array.isArray(data?.cards) ? data.cards.filter((c) => c?.widoczny === true) - : []; + : []) as InternetCard[]; -const phoneCards: PhoneCard[] = Array.isArray(phoneData?.cards) +const phoneCards = (Array.isArray(phoneData?.cards) ? phoneData.cards.filter((c) => c?.widoczny === true) - : []; + : []) as PhoneCard[]; -const addons: Addon[] = Array.isArray(addonsData?.dodatki) +const addons = (Array.isArray(addonsData?.dodatki) ? addonsData.dodatki - : []; + : []) as Addon[]; -// jeśli chcesz, możesz nadpisać cenaOpis w modalu z addons.yaml: const addonsCenaOpis = addonsData?.cena_opis ?? cenaOpis; type SwitchOption = { id: string | number; nazwa: string }; @@ -80,9 +79,9 @@ const switchesData = loadYamlFile( path.join(process.cwd(), "src", "content", "site", "switches.yaml"), ); -const switches: SwitchDef[] = Array.isArray(switchesData?.switches) +const switches = (Array.isArray(switchesData?.switches) ? switchesData.switches - : []; + : []) as SwitchDef[]; --- @@ -92,6 +91,7 @@ const switches: SwitchDef[] = Array.isArray(switchesData?.switches) client:load title={tytul} description={opis} + uwaga={uwaga} cards={cards} waluta={waluta} cenaOpis={cenaOpis} @@ -101,7 +101,8 @@ const switches: SwitchDef[] = Array.isArray(switchesData?.switches) switches={switches} /> +

* {uwaga}

-
+ \ No newline at end of file diff --git a/src/pages/internet-telewizja/index.astro b/src/pages/internet-telewizja/index.astro index 3b94c91..f4daea0 100644 --- a/src/pages/internet-telewizja/index.astro +++ b/src/pages/internet-telewizja/index.astro @@ -32,13 +32,13 @@ type Card = { type CardsYaml = { tytul?: string; opis?: string; + uwaga?: string; waluta?: string; cena_opis?: string; internet_parametry_wspolne?: Param[]; cards?: Card[]; }; -// ✅ telefon z YAML (do modala) type PhoneParam = { klucz: string; label: string; value: string | number }; type PhoneCard = { id?: string; @@ -52,7 +52,6 @@ type PhoneYaml = { cards?: PhoneCard[] }; type Decoder = { id: string; nazwa: string; opis: string; cena: number }; -// ✅ dodatki z YAML (do modala) type Addon = { id: string; nazwa: string; @@ -72,17 +71,6 @@ type AddonsYaml = { dodatki?: Addon[]; }; -// type ChannelsYaml = { -// title?: string; -// updated_at?: string; -// channels?: Array<{ -// nazwa: string; -// opis?: string; -// image?: string; -// pakiety?: string[]; -// }>; -// }; - const seo = loadYamlFile( path.join(process.cwd(), "src", "content", "internet-telewizja", "seo.yaml"), ); @@ -99,6 +87,7 @@ const data = loadYamlFile( 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."; @@ -111,7 +100,6 @@ const cards: Card[] = Array.isArray(data?.cards) ? data.cards.filter((c) => c?.widoczny === true) : []; -// ✅ NOWE: dane do modala dodatków (bez ruszania reszty) const phoneYaml = loadYamlFile( path.join(process.cwd(), "src", "content", "telefon", "cards.yaml"), ); @@ -169,6 +157,7 @@ const switches: SwitchDef[] = Array.isArray(switchesYaml?.switches) client:load title={tytul} description={opis} + uwaga={uwaga} cards={cards} internetWspolne={internetWspolne} waluta={waluta} @@ -180,8 +169,9 @@ const switches: SwitchDef[] = Array.isArray(switchesYaml?.switches) addonsCenaOpis={addonsCenaOpis} switches={switches} /> +

* {uwaga}

- + \ No newline at end of file