import Typography from "@/shared/ui/components/Typography/Typography";
import "./Privacy.scss";
import Image from "next/image";
import header from "./assets/header.svg";
import { Metadata } from "next";
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
import { apiInstance } from "@/shared/config/apiConfig";
import { IMetatag } from "@/shared/types/metatag-type";
import { useTranslations } from "next-intl";

export async function generateMetadata(): Promise<Metadata> {
  const data = await apiInstance
    .get<IMetatag[]>("/metatags/")
    .then((res) => res.data)
    .catch((e) => console.log(e));

  if (!data)
    return {
      title: "KG ROAD | О нас",
      description:
        "Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
      openGraph: {
        title: "KG ROAD | О нас",
        description:
          "Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
      },
    };

  const metadata = data.filter((tag) => tag.page === "privacy")[0];
  if (!metadata) {
    return {
      title: "KG ROAD | О нас",
      description:
        "Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
      openGraph: {
        title: "KG ROAD | О нас",
        description:
          "Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
      },
    };
  }

  return {
    title: `KG ROAD | ${metadata.title}`,
    description: metadata.description,
    keywords: metadata.keywords.split(","),
    openGraph: {
      title: `KG ROAD | ${metadata.title}`,
      description: metadata.description,
      type: "website",
    },
  };
}

const Privacy = () => {
  const tPrivacyPolicy = useTranslations("PrivacyPolicy");
  return (
    <div className="privacy page-padding">
      <BreadCrumbs homeRequired />
      <Typography element="h2">{tPrivacyPolicy("titel0")}</Typography>
      <div className="privacy__descriptions">
      <ol>
<h3><span>{tPrivacyPolicy("title1")}</span></h3>
</ol>
<p><span>
    {tPrivacyPolicy("p1")}
    <a href='https://askjournal.kg/'>https://askjournal.kg/</a>
    {tPrivacyPolicy("p1o")}
  </span></p>
<h3><span>{tPrivacyPolicy("title2")}</span></h3>
<p><span>{tPrivacyPolicy("p2")}</span></p>
<h3><span>{tPrivacyPolicy("title3")}</span></h3>
<p><span>{tPrivacyPolicy("p3")}</span></p>
<p><span>{tPrivacyPolicy("p4")}</span></p>
<p><span>{tPrivacyPolicy("p5")}</span></p>
<p><span>{tPrivacyPolicy("p6")}</span></p>
<p><span>{tPrivacyPolicy("p7")}</span></p>
<h3><span>{tPrivacyPolicy("title4")}</span></h3>
<p><span>{tPrivacyPolicy("p8")}</span></p>
<h3><span>{tPrivacyPolicy("title5")}</span></h3>
<p><span>{tPrivacyPolicy("p9")}</span></p>
<p><span>{tPrivacyPolicy("p10")}</span></p>
<p><span>{tPrivacyPolicy("p11")}</span></p>
<h3><span>{tPrivacyPolicy("title6")}</span></h3>
<p><span>{tPrivacyPolicy("p12")}</span></p>
<p><span>{tPrivacyPolicy("p13")}</span></p>
<p><span>{tPrivacyPolicy("p14")}</span></p>
<p><span>{tPrivacyPolicy("p15")}</span></p>
<p><span>{tPrivacyPolicy("p16")}</span></p>
<h3><span>{tPrivacyPolicy("title7")}</span></h3>
<p><span>{tPrivacyPolicy("p17")}</span></p>
<p><span>{tPrivacyPolicy("p18")}</span></p>
<p><span>{tPrivacyPolicy("p19")}</span></p>
      </div>
    </div>
  );
};

export default Privacy;
