import Head from "next/head";
import { AreaRiservataLayout } from "~/components/Layout";
import type { NextPageWithLayout } from "~/pages/_app";
import { useTranslation } from "~/providers/I18nProvider";
import { api } from "~/utils/api";
const Impostazioni: NextPageWithLayout = () => {
const { t } = useTranslation();
return (
<>
{t.heads.area_riservata_titolo}
>
);
};
export default Impostazioni;
// export const getServerSideProps = (async (context) => {
// const access_token = context.req.cookies.access_token;
// const helpers = await TrpcAuthedFetchingIstance({ access_token });
// if (helpers) {
// return {
// props: {
// trpcState: helpers.trpc.dehydrate(),
// },
// };
// }
// return {
// props: {},
// };
// }) satisfies GetServerSideProps;
Impostazioni.getLayout = function getLayout(page) {
return {page};
};
const StripeSection = () => {
const { data, isLoading } = api.stripe.health.useQuery();
if (isLoading) {
return Loading...
;
}
console.log(data);
return (
Stripe Status: {data?.success ? "Sano" : "Non sano"}
Endpoint Webhook:
{data?.endpoints?.data.map((endpoint) => (
ID: {endpoint.id}
URL: {endpoint.url}
Eventi attivi:
{endpoint.enabled_events.map((event) => (
- {event}
))}
Versione Api: {endpoint.api_version}
Stato: {endpoint.status}
))}
);
};