---
import yaml from "js-yaml";
import fs from "fs";

const footer = yaml.load(
  fs.readFileSync("./src/content/site/footer.yaml", "utf8"),
);
---

<footer class="f-footer">
  <div class="f-footer-inner">
    <div class="f-footer-col">
      <h3>{footer.company.name}</h3>
      <p>
        {footer.company.address.line1}<br />
        {footer.company.address.line2}
      </p>
      <a href="/dokumenty/polityka-prywatnosci" title="Polityka prywatności">Polityka prywatności</a>
    </div>

    <div class="f-footer-col">
      <h4>{footer.contact.title}</h4>
      {
        footer.contact.phones.map((phone: string) => (
          <p>
            {phone}
          </p>
        ))
      }
      <p class="f-footer-col-text">
        <a href={`mailto:${footer.contact.email}`}>
          {footer.contact.email}
        </a>
      </p>
    </div>

    <div class="f-footer-col">
      <h4>{footer.services.title}</h4>
      <ul>
        {
          footer.services.items.map((item: any) => (
            <li>
              <a href={item.url} title={item.title}>
                {item.name}
              </a>
            </li>
          ))
        }
      </ul>
    </div>
  </div>

  <div class="f-footer-copyright">
    © {new Date().getFullYear()} FUZ Adam Rojek. Wszystkie prawa zastrzeżone.

    <div class="f-footer-recaptcha" set:html={footer.recaptcha} />
  </div>
</footer>
