@@ -6,9 +6,10 @@ import Loader from '../components/Loader'
66import { DID , DIDKey } from '@ucanto/interface'
77import { DidIcon } from './DidIcon'
88import 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'
1011
11- export function SpaceCreatorCreating ( ) : JSX . Element {
12+ export function SpaceCreatorCreating ( ) : JSX . Element {
1213 return (
1314 < div className = 'flex flex-col items-center space-y-4' >
1415 < h5 className = 'font-epilogue' > Creating Space...</ h5 >
@@ -21,7 +22,7 @@ interface SpaceCreatorFormProps {
2122 className ?: string
2223}
2324
24- export function SpaceCreatorForm ( {
25+ export function SpaceCreatorForm ( {
2526 className = ''
2627} : SpaceCreatorFormProps ) : JSX . Element {
2728 const [ { client, accounts } ] = useW3 ( )
@@ -30,11 +31,11 @@ export function SpaceCreatorForm ({
3031 const [ name , setName ] = useState ( '' )
3132 const [ space , setSpace ] = useState < Space > ( )
3233
33- function resetForm ( ) : void {
34+ function resetForm ( ) : void {
3435 setName ( '' )
3536 }
3637
37- async function onSubmit ( e : React . FormEvent < HTMLFormElement > ) : Promise < void > {
38+ async function onSubmit ( e : React . FormEvent < HTMLFormElement > ) : Promise < void > {
3839 e . preventDefault ( )
3940 if ( ! client ) return
4041 // TODO: account selection
@@ -115,7 +116,7 @@ export function SpaceCreatorForm ({
115116 required = { true }
116117 />
117118 < 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
119120 </ button >
120121 </ form >
121122 </ div >
@@ -126,7 +127,7 @@ interface SpaceCreatorProps {
126127 className ?: string
127128}
128129
129- export function SpaceCreator ( {
130+ export function SpaceCreator ( {
130131 className = ''
131132} : SpaceCreatorProps ) : JSX . Element {
132133 const [ creating , setCreating ] = useState ( false )
@@ -150,16 +151,25 @@ export function SpaceCreator ({
150151 /* eslint-enable no-nested-ternary */
151152}
152153
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 ) {
154161 return (
155162 < figure className = 'p-4 flex flex-row items-start gap-2 rounded' >
156163 < Link href = { `/space/${ did } ` } className = 'block' >
157164 < DidIcon did = { did } />
158165 </ Link >
159166 < figcaption className = 'grow' >
160167 < 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 >
163173 </ span >
164174 < span className = 'block font-mono text-xs truncate' >
165175 { did }
0 commit comments