Path: blob/master/src/packages/next/components/statistics/index.tsx
1450 views
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Stats } from "@cocalc/util/db-schema/stats";6import OpenedFiles from "./opened-files";7import ActiveUsers from "./active-users";8import ActiveProjects from "./active-projects";9import A from "components/misc/A";10import { CSS, Paragraph } from "components/misc";1112const STYLE: CSS = {13marginBottom: "40px",14} as const;1516interface Props {17stats: Stats;18}1920export default function Statistics({ stats }: Props) {21return (22<div style={{ maxWidth: "100%", overflowX: "auto" }}>23<Paragraph style={STYLE}>24Last Updated: {new Date(stats.time).toLocaleString()}{" "}25<A href="/info/status">(update)</A>26</Paragraph>27<ActiveUsers28created={stats.accounts_created}29active={stats.accounts_active}30hubServers={stats.hub_servers}31style={STYLE}32/>33<ActiveProjects34style={STYLE}35created={stats.projects_created}36active={stats.projects_edited}37running={stats.running_projects}38/>39<OpenedFiles style={STYLE} filesOpened={stats.files_opened} />40</div>41);42}434445