1+ import { DebugInvitations } from '@/components/debug-invitations' ;
12import { DebugSpaceEvents } from '@/components/debug-space-events' ;
23import { DebugSpaceState } from '@/components/debug-space-state' ;
34import { Button } from '@/components/ui/button' ;
@@ -7,6 +8,7 @@ import { Effect, Exit } from 'effect';
78import * as Schema from 'effect/Schema' ;
89import type {
910 EventMessage ,
11+ Invitation ,
1012 RequestListInvitations ,
1113 RequestListSpaces ,
1214 RequestSubscribeToSpace ,
@@ -46,6 +48,7 @@ export const Route = createFileRoute('/playground')({
4648const App = ( { accountId, signaturePrivateKey } : { accountId : string ; signaturePrivateKey : string } ) => {
4749 const [ websocketConnection , setWebsocketConnection ] = useState < WebSocket > ( ) ;
4850 const [ spaces , setSpaces ] = useState < SpaceStorageEntry [ ] > ( [ ] ) ;
51+ const [ invitations , setInvitations ] = useState < Invitation [ ] > ( [ ] ) ;
4952
5053 useEffect ( ( ) => {
5154 // temporary until we have a way to create accounts and authenticate them
@@ -109,7 +112,7 @@ const App = ({ accountId, signaturePrivateKey }: { accountId: string; signatureP
109112 break ;
110113 }
111114 case 'list-invitations' : {
112- console . log ( 'list- invitations' , response ) ;
115+ setInvitations ( response . invitations . map ( ( invitation ) => invitation ) ) ;
113116 break ;
114117 }
115118 default :
@@ -182,7 +185,9 @@ const App = ({ accountId, signaturePrivateKey }: { accountId: string; signatureP
182185 List Invitations
183186 </ Button >
184187 </ div >
185- < h2 > Spaces</ h2 >
188+ < h2 className = "text-lg" > Invitations</ h2 >
189+ < DebugInvitations invitations = { invitations } />
190+ < h2 className = "text-lg" > Spaces</ h2 >
186191 < ul >
187192 { spaces . map ( ( space ) => {
188193 return (
0 commit comments