import { ExternalLinkIcon } from "@heroicons/react/solid"; import { GetServerSidePropsContext } from "next"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { getSession } from "@lib/auth"; import { getOrSetUserLocaleFromHeaders } from "@lib/core/i18n/i18n.utils"; import { useLocale } from "@lib/hooks/useLocale"; import prisma from "@lib/prisma"; import SettingsShell from "@components/SettingsShell"; import Shell from "@components/Shell"; import Button from "@components/ui/Button"; export default function Billing() { const { t } = useLocale(); return (

{t("view_and_manage_billing_details")}

{t("view_and_edit_billing_details")}

{t("need_anything_else")}

{t("further_billing_help")}

); } export async function getServerSideProps(context: GetServerSidePropsContext) { const session = await getSession(context); const locale = await getOrSetUserLocaleFromHeaders(context.req); if (!session) { return { redirect: { permanent: false, destination: "/auth/login" } }; } const user = await prisma.user.findFirst({ where: { email: session.user.email, }, select: { id: true, username: true, name: true, email: true, bio: true, avatar: true, timeZone: true, weekStart: true, }, }); return { props: { session, user, ...(await serverSideTranslations(locale, ["common"])), }, }; }