2022-05-14 13:49:39 +00:00
|
|
|
import classNames from "classnames";
|
2022-01-27 10:16:20 +00:00
|
|
|
|
2023-04-19 20:55:40 +00:00
|
|
|
import { HeadSeo, Logo } from "@calcom/ui";
|
2022-07-01 17:19:52 +00:00
|
|
|
|
2022-01-27 10:16:20 +00:00
|
|
|
import Loader from "@components/Loader";
|
2023-01-02 19:44:51 +00:00
|
|
|
|
2022-01-27 10:16:20 +00:00
|
|
|
interface Props {
|
|
|
|
title: string;
|
|
|
|
description: string;
|
|
|
|
footerText?: React.ReactNode | string;
|
|
|
|
showLogo?: boolean;
|
|
|
|
heading?: string;
|
|
|
|
loading?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function AuthContainer(props: React.PropsWithChildren<Props>) {
|
|
|
|
return (
|
2023-10-09 11:51:47 +00:00
|
|
|
<div className="bg-subtle dark:bg-darkgray-50 flex min-h-screen flex-col justify-center py-12 sm:px-6 lg:px-8">
|
2022-01-27 10:16:20 +00:00
|
|
|
<HeadSeo title={props.title} description={props.description} />
|
2023-04-19 20:55:40 +00:00
|
|
|
{props.showLogo && <Logo small inline={false} className="mx-auto mb-auto" />}
|
2023-01-02 14:54:35 +00:00
|
|
|
|
2022-05-14 13:49:39 +00:00
|
|
|
<div className={classNames(props.showLogo ? "text-center" : "", "sm:mx-auto sm:w-full sm:max-w-md")}>
|
2023-04-05 18:14:46 +00:00
|
|
|
{props.heading && <h2 className="font-cal text-emphasis text-center text-3xl">{props.heading}</h2>}
|
2022-01-27 10:16:20 +00:00
|
|
|
</div>
|
|
|
|
{props.loading && (
|
2023-04-05 18:14:46 +00:00
|
|
|
<div className="bg-muted absolute z-50 flex h-screen w-full items-center">
|
2022-01-27 10:16:20 +00:00
|
|
|
<Loader />
|
|
|
|
</div>
|
|
|
|
)}
|
2022-11-01 13:29:01 +00:00
|
|
|
<div className="mb-auto mt-8 sm:mx-auto sm:w-full sm:max-w-md">
|
2023-10-09 11:51:47 +00:00
|
|
|
<div className="bg-default dark:bg-muted border-subtle mx-2 rounded-md border px-4 py-10 sm:px-10">
|
2022-01-27 10:16:20 +00:00
|
|
|
{props.children}
|
|
|
|
</div>
|
2023-04-05 18:14:46 +00:00
|
|
|
<div className="text-default mt-8 text-center text-sm">{props.footerText}</div>
|
2022-01-27 10:16:20 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|