@@ -2,31 +2,45 @@ import type { FunctionComponent } from "react";
22import Section from "./common/Section" ;
33import { FormControl , FormField , FormItem , FormLabel } from "./ui/form" ;
44import { Input } from "./ui/input" ;
5+ import { InputWithButton } from "./ui/input-with-button" ;
6+ import { useActiveOrg } from "@/hooks/useActiveOrg" ;
57
68interface OrgFormProps {
79 forceVertical ?: boolean ;
810}
9-
1011export const OrgForm : FunctionComponent < OrgFormProps > = ( {
1112 forceVertical = true ,
12- } ) => (
13- < Section
14- description = "Enter the name of your organization. This will be used to identify your organization in the system."
15- title = "General Information"
16- forceVertical = { forceVertical }
17- >
18- < div className = "mt-6" >
19- < FormField
20- name = "name"
21- render = { ( { field } ) => (
22- < FormItem >
23- < FormLabel > Organization name*</ FormLabel >
24- < FormControl >
25- < Input data-testid = "org-name-label" { ...field } />
26- </ FormControl >
27- </ FormItem >
28- ) }
29- />
30- </ div >
31- </ Section >
32- ) ;
13+ } ) => {
14+ const activeOrg = useActiveOrg ( ) ;
15+ const orgID = activeOrg . id ;
16+
17+ return (
18+ < Section
19+ description = "Enter the name of your organization. This will be used to identify your organization in the system."
20+ title = "General Information"
21+ forceVertical = { forceVertical }
22+ >
23+ < div className = "mt-6" >
24+ < FormField
25+ name = "name"
26+ render = { ( { field } ) => (
27+ < FormItem >
28+ < FormLabel > Organization name*</ FormLabel >
29+ < FormControl >
30+ < Input data-testid = "org-name-label" { ...field } />
31+ </ FormControl >
32+ </ FormItem >
33+ ) }
34+ />
35+ < InputWithButton
36+ label = "Organization-ID"
37+ value = { `${ orgID } ` }
38+ nameKey = "settings-org-id"
39+ variant = "default"
40+ copyable
41+ copyToastDescription = "The organization ID has been copied to your clipboard."
42+ />
43+ </ div >
44+ </ Section >
45+ ) ;
46+ } ;
0 commit comments