Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/dashboard/src/user-settings/IntegrationItemEntry.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 { ContextMenuEntry } from "../components/ContextMenu";
8
import { Item, ItemFieldIcon, ItemField, ItemFieldContextMenu } from "../components/ItemsList";
9
import { AuthProvider } from "@gitpod/public-api/lib/gitpod/v1/authprovider_pb";
10
import { toAuthProviderLabel } from "../provider-utils";
11
12
export const IntegrationEntryItem = (props: {
13
ap: AuthProvider;
14
gitProviderMenu: (provider: AuthProvider) => ContextMenuEntry[];
15
}) => {
16
return (
17
<Item key={"ap-" + props.ap.id} className="h-16">
18
<ItemFieldIcon>
19
<div
20
className={
21
"rounded-full w-3 h-3 text-sm align-middle m-auto " +
22
(props.ap.verified ? "bg-green-500" : "bg-gray-400")
23
}
24
>
25
&nbsp;
26
</div>
27
</ItemFieldIcon>
28
<ItemField className="w-3/12 flex flex-col my-auto">
29
<span className="font-medium truncate overflow-ellipsis">{toAuthProviderLabel(props.ap.type)}</span>
30
</ItemField>
31
<ItemField className="w-7/12 flex flex-col my-auto">
32
<span className="my-auto truncate text-gray-500 overflow-ellipsis">{props.ap.host}</span>
33
</ItemField>
34
<ItemFieldContextMenu menuEntries={props.gitProviderMenu(props.ap)} />
35
</Item>
36
);
37
};
38
39