paper-ai-release-24-07-21/components/Footer/index.js
2024-02-12 21:35:00 +08:00

26 lines
729 B
JavaScript

import Link from "next/link";
import { Trans } from "react-i18next/TransWithoutContext";
import { languages } from "../../../i18n/settings";
import { useTranslation } from "../../../i18n";
export const Footer = async ({ lng }) => {
const { t } = await useTranslation(lng, "footer");
return (
<footer style={{ marginTop: 50 }}>
<Trans i18nKey="languageSwitcher" t={t}>
Switch from <strong>{{ lng }}</strong> to:{" "}
</Trans>
{languages
.filter((l) => lng !== l)
.map((l, index) => {
return (
<span key={l}>
{index > 0 && " or "}
<Link href={`/${l}`}>{l}</Link>
</span>
);
})}
</footer>
);
};