Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/dashboard/src/workspaces/EmptyWorkspacesContent.tsx
2500 views
1
/**
2
* Copyright (c) 2023 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 { LinkButton } from "@podkit/buttons/LinkButton";
8
import { Heading2, Subheading } from "@podkit/typography/Headings";
9
import { StartWorkspaceModalKeyBinding } from "../App";
10
import { VideoSection } from "../onboarding/VideoSection";
11
import { trackVideoClick } from "../Analytics";
12
import { useInstallationConfiguration } from "../data/installation/installation-config-query";
13
14
export const EmptyWorkspacesContent = () => {
15
const { data: installationConfig } = useInstallationConfiguration();
16
const isDedicatedInstallation = !!installationConfig?.isDedicatedInstallation;
17
18
const handlePlay = () => {
19
trackVideoClick("create-new-workspace");
20
};
21
22
return (
23
<div className="app-container flex flex-col space-y-2">
24
<div className="px-6 mt-16 flex flex-col xl:flex-row items-center justify-center gap-x-14 gap-y-10 min-h-96 min-w-96">
25
{isDedicatedInstallation ? (
26
<div className="flex flex-col items-center text-center justify-center">
27
<Heading2 className="!font-semibold !text-lg">No workspaces</Heading2>
28
<Subheading className="max-w-xs xl:text-left text-center">
29
Create a new workspace to start coding
30
</Subheading>
31
<div className="flex flex-col mt-4 w-fit">
32
<LinkButton href={"/new"} className="gap-1.5">
33
New Workspace{" "}
34
<span className="opacity-60 hidden md:inline">{StartWorkspaceModalKeyBinding}</span>
35
</LinkButton>
36
</div>
37
</div>
38
) : (
39
<>
40
<VideoSection
41
metadataVideoTitle="Gitpod demo"
42
playbackId="m01BUvCkTz7HzQKFoIcQmK00Rx5laLLoMViWBstetmvLs"
43
poster="https://i.ytimg.com/vi_webp/1ZBN-b2cIB8/maxresdefault.webp"
44
playerProps={{ onPlay: handlePlay, defaultHiddenCaptions: true }}
45
className="w-[535px] rounded-xl"
46
/>
47
<div className="flex flex-col items-center xl:items-start justify-center">
48
<Heading2 className="mb-4 !font-semibold !text-lg">Create your first workspace</Heading2>
49
<Subheading className="max-w-xs xl:text-left text-center">
50
Write code in your personal development environment that’s running in the cloud
51
</Subheading>
52
<span className="flex flex-col space-y-4 w-fit">
53
<LinkButton
54
variant="secondary"
55
className="mt-4 border !border-pk-content-invert-primary text-pk-content-secondary bg-pk-surface-secondary"
56
href={"/new?showExamples=true"}
57
>
58
Try a configured demo repository
59
</LinkButton>
60
<LinkButton href={"/new"} className="gap-1.5">
61
Configure your own repository
62
</LinkButton>
63
</span>
64
</div>
65
</>
66
)}
67
</div>
68
</div>
69
);
70
};
71
72