Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/dashboard/src/insights/WorkspaceSession.tsx
2500 views
1
/**
2
* Copyright (c) 2024 Gitpod GmbH. All rights reserved.
3
* Licensed under the GNU Affero General Public License (AGPL).
4
* See License.AGPL.txt in the project root for license information.
5
*/
6
7
import { WorkspacePhase_Phase, WorkspaceSession } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb";
8
import { displayTime } from "./WorkspaceSessionGroup";
9
10
type Props = {
11
session: WorkspaceSession;
12
};
13
export const WorkspaceSessionEntry = ({ session }: Props) => {
14
const isRunning = session?.workspace?.status?.phase?.name === WorkspacePhase_Phase.RUNNING;
15
16
return (
17
<li className="text-sm text-gray-600 dark:text-gray-300">
18
{session.creationTime ? displayTime(session.creationTime) : "n/a"} (
19
{session.id.slice(0, 7) || "No instance ID"}){isRunning ? " - running" : ""}
20
</li>
21
);
22
};
23
24