Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/components/account/account.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { useEffect } from "react";6import { useRouter } from "next/router";7import { trunc } from "lib/share/util";8import Loading from "components/share/loading";9import { Customize } from "lib/share/customize";10import PublicPaths from "components/share/public-paths";11import { Layout } from "components/share/layout";12import Avatar from "components/account/avatar";1314interface Props {15first_name: string;16last_name: string;17publicPaths;18customize;19account_id: string;20redirect?: string;21}2223export default function Account({24first_name,25last_name,26publicPaths,27customize,28account_id,29redirect,30}: Props) {31const router = useRouter();32useEffect(() => {33if (redirect) {34router.replace(redirect);35}36}, [redirect]);3738if (first_name == null || last_name == null || publicPaths == null) {39return <Loading style={{ fontSize: "30px" }} />;40}41const name = trunc(`${first_name} ${last_name}`, 150);42const client_id = customize.account?.account_id;43return (44<Customize value={customize}>45<Layout title={name}>46<h1>47<Avatar account_id={account_id} /> {name}48</h1>49{client_id == account_id ? (50<>51You are an active collaborator on projects that contain the52published documents listed below. We include any unlisted or53disabled published documents so that you can browse or edit them54from here. This full list is only visible to you (other people only55see public documents).56</>57) : (58<>59{name} is an active collaborator on projects that contain the60following public documents:61</>62)}63<br />64<br />65<PublicPaths publicPaths={publicPaths} />66</Layout>67</Customize>68);69}707172