2022-12-07 20:53:44 +00:00
|
|
|
import { GetServerSidePropsContext } from "next";
|
|
|
|
|
2022-11-10 20:23:56 +00:00
|
|
|
import { TeamsListing } from "@calcom/features/ee/teams/components";
|
|
|
|
import { WEBAPP_URL } from "@calcom/lib/constants";
|
2022-09-17 17:53:31 +00:00
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
2022-11-23 02:55:25 +00:00
|
|
|
import { Button, Icon, Shell } from "@calcom/ui";
|
2022-09-17 17:53:31 +00:00
|
|
|
|
2022-12-07 20:53:44 +00:00
|
|
|
import { ssrInit } from "@server/lib/ssr";
|
|
|
|
|
2022-09-17 17:53:31 +00:00
|
|
|
function Teams() {
|
|
|
|
const { t } = useLocale();
|
|
|
|
return (
|
|
|
|
<Shell
|
|
|
|
heading={t("teams")}
|
|
|
|
subtitle={t("create_manage_teams_collaborative")}
|
|
|
|
CTA={
|
2022-12-19 14:38:33 +00:00
|
|
|
<Button type="button" href={`${WEBAPP_URL}/settings/teams/new?returnTo=/teams`}>
|
2022-09-17 17:53:31 +00:00
|
|
|
<Icon.FiPlus className="inline-block h-3.5 w-3.5 text-white group-hover:text-black ltr:mr-2 rtl:ml-2" />
|
|
|
|
{t("new")}
|
|
|
|
</Button>
|
|
|
|
}>
|
2022-11-10 20:23:56 +00:00
|
|
|
<TeamsListing />
|
2022-09-17 17:53:31 +00:00
|
|
|
</Shell>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Teams.requiresLicense = false;
|
|
|
|
|
2022-12-07 20:53:44 +00:00
|
|
|
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
|
|
|
|
const ssr = await ssrInit(context);
|
|
|
|
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
trpcState: ssr.dehydrate(),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-17 17:53:31 +00:00
|
|
|
export default Teams;
|