CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/account/name.tsx
Views: 687
1
import { CSSProperties } from "react";
2
import useProfile from "lib/hooks/profile";
3
import { trunc } from "lib/share/util";
4
5
interface Props {
6
account_id: string;
7
style?: CSSProperties;
8
}
9
10
export default function Name({ account_id, style }: Props) {
11
const profile = useProfile({ account_id });
12
if (profile == null) {
13
return <></>;
14
}
15
const { first_name, last_name } = profile;
16
return <span style={style}>{trunc(`${first_name} ${last_name}`, 50)}</span>;
17
}
18
19