@@ -5,14 +5,27 @@ import * as Yup from "yup";
5
5
import { isApiValidationError } from "api/errors" ;
6
6
import type { CreateOrganizationRequest } from "api/typesGenerated" ;
7
7
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
8
+ import {
9
+ Badges ,
10
+ DisabledBadge ,
11
+ PremiumBadge ,
12
+ EntitledBadge ,
13
+ } from "components/Badges/Badges" ;
8
14
import {
9
15
FormFields ,
10
16
FormSection ,
11
17
HorizontalForm ,
12
18
FormFooter ,
13
19
} from "components/Form/Form" ;
14
20
import { IconField } from "components/IconField/IconField" ;
21
+ import { PopoverPaywall } from "components/Paywall/PopoverPaywall" ;
22
+ import {
23
+ Popover ,
24
+ PopoverContent ,
25
+ PopoverTrigger ,
26
+ } from "components/Popover/Popover" ;
15
27
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader" ;
28
+ import { docs } from "utils/docs" ;
16
29
import {
17
30
getFormHelpers ,
18
31
nameValidator ,
@@ -35,11 +48,12 @@ const validationSchema = Yup.object({
35
48
interface CreateOrganizationPageViewProps {
36
49
error : unknown ;
37
50
onSubmit : ( values : CreateOrganizationRequest ) => Promise < void > ;
51
+ isEntitled : boolean ;
38
52
}
39
53
40
54
export const CreateOrganizationPageView : FC <
41
55
CreateOrganizationPageViewProps
42
- > = ( { error, onSubmit } ) => {
56
+ > = ( { error, onSubmit, isEntitled } ) => {
43
57
const form = useFormik < CreateOrganizationRequest > ( {
44
58
initialValues : {
45
59
name : "" ,
@@ -59,6 +73,26 @@ export const CreateOrganizationPageView: FC<
59
73
description = "Organize your deployment into multiple platform teams."
60
74
/>
61
75
76
+ < Badges >
77
+ { isEntitled ? < EntitledBadge /> : < DisabledBadge /> }
78
+ < Popover mode = "hover" >
79
+ < PopoverTrigger >
80
+ < span >
81
+ < PremiumBadge />
82
+ </ span >
83
+ </ PopoverTrigger >
84
+ < PopoverContent css = { { transform : "translateY(-28px)" } } >
85
+ < PopoverPaywall
86
+ message = "Organizations"
87
+ description = "Organizations allow you to run a Coder deployment with multiple platform teams, all with unique use cases, templates, and even underlying infrastructure."
88
+ // TODO: No documentation link yet.
89
+ documentationLink = { docs ( "/admin" ) }
90
+ licenseType = "premium"
91
+ />
92
+ </ PopoverContent >
93
+ </ Popover >
94
+ </ Badges >
95
+
62
96
{ Boolean ( error ) && ! isApiValidationError ( error ) && (
63
97
< div css = { { marginBottom : 32 } } >
64
98
< ErrorAlert error = { error } />
0 commit comments