@@ -6,9 +6,10 @@ import Loader from '../components/Loader'
6
6
import { DID , DIDKey } from '@ucanto/interface'
7
7
import { DidIcon } from './DidIcon'
8
8
import Link from 'next/link'
9
- import { FolderPlusIcon } from '@heroicons/react/24/outline'
9
+ import { FolderPlusIcon , InformationCircleIcon } from '@heroicons/react/24/outline'
10
+ import Tooltip from './Tooltip'
10
11
11
- export function SpaceCreatorCreating ( ) : JSX . Element {
12
+ export function SpaceCreatorCreating ( ) : JSX . Element {
12
13
return (
13
14
< div className = 'flex flex-col items-center space-y-4' >
14
15
< h5 className = 'font-epilogue' > Creating Space...</ h5 >
@@ -21,7 +22,7 @@ interface SpaceCreatorFormProps {
21
22
className ?: string
22
23
}
23
24
24
- export function SpaceCreatorForm ( {
25
+ export function SpaceCreatorForm ( {
25
26
className = ''
26
27
} : SpaceCreatorFormProps ) : JSX . Element {
27
28
const [ { client, accounts } ] = useW3 ( )
@@ -30,11 +31,11 @@ export function SpaceCreatorForm ({
30
31
const [ name , setName ] = useState ( '' )
31
32
const [ space , setSpace ] = useState < Space > ( )
32
33
33
- function resetForm ( ) : void {
34
+ function resetForm ( ) : void {
34
35
setName ( '' )
35
36
}
36
37
37
- async function onSubmit ( e : React . FormEvent < HTMLFormElement > ) : Promise < void > {
38
+ async function onSubmit ( e : React . FormEvent < HTMLFormElement > ) : Promise < void > {
38
39
e . preventDefault ( )
39
40
if ( ! client ) return
40
41
// TODO: account selection
@@ -115,7 +116,7 @@ export function SpaceCreatorForm ({
115
116
required = { true }
116
117
/>
117
118
< button type = 'submit' className = { `inline-block bg-hot-red border border-hot-red hover:bg-white hover:text-hot-red font-epilogue text-white uppercase text-sm px-6 py-2 rounded-full whitespace-nowrap` } >
118
- < FolderPlusIcon className = 'h-5 w-5 inline-block mr-1 align-middle' style = { { marginTop : - 4 } } /> Create
119
+ < FolderPlusIcon className = 'h-5 w-5 inline-block mr-1 align-middle' style = { { marginTop : - 4 } } /> Create
119
120
</ button >
120
121
</ form >
121
122
</ div >
@@ -126,7 +127,7 @@ interface SpaceCreatorProps {
126
127
className ?: string
127
128
}
128
129
129
- export function SpaceCreator ( {
130
+ export function SpaceCreator ( {
130
131
className = ''
131
132
} : SpaceCreatorProps ) : JSX . Element {
132
133
const [ creating , setCreating ] = useState ( false )
@@ -150,16 +151,25 @@ export function SpaceCreator ({
150
151
/* eslint-enable no-nested-ternary */
151
152
}
152
153
153
- export function SpacePreview ( { did, name } : { did : DIDKey , name ?: string } ) {
154
+ interface SpacePreviewProps {
155
+ did : DIDKey
156
+ name ?: string
157
+ capabilities : string [ ]
158
+ }
159
+
160
+ export function SpacePreview ( { did, name, capabilities } : SpacePreviewProps ) {
154
161
return (
155
162
< figure className = 'p-4 flex flex-row items-start gap-2 rounded' >
156
163
< Link href = { `/space/${ did } ` } className = 'block' >
157
164
< DidIcon did = { did } />
158
165
</ Link >
159
166
< figcaption className = 'grow' >
160
167
< Link href = { `/space/${ did } ` } className = 'block' >
161
- < span className = 'font-epilogue text-lg text-hot-red font-semibold leading-5 m-0' >
162
- { name ?? 'Untitled' }
168
+ < span className = 'font-epilogue text-lg text-hot-red font-semibold leading-5 m-0 flex items-center' >
169
+ { name ?? 'Untitled' }
170
+ < Tooltip title = "Capabilities" text = { capabilities } >
171
+ < InformationCircleIcon className = 'h-5 w-5 ml-2' />
172
+ </ Tooltip >
163
173
</ span >
164
174
< span className = 'block font-mono text-xs truncate' >
165
175
{ did }
0 commit comments