[Chat] Reusable loading/unavailable states for chat invites (#10819)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-06-10 21:54:37 +03:00
committed by GitHub
parent 3095bbfbec
commit 3b5ede37f7
9 changed files with 122 additions and 89 deletions
+20 -2
View File
@@ -82,8 +82,7 @@ let MessageItemInviteEmbed = ({
initialPreview={embed.joinLinkPreview}
currentConvoId={convo.convo.view.id}
hasFixedHeight={false}>
<ChatInvite.Card size="small" />
<ChatInvite.JoinButton />
<MessageItemInviteEmbedBody />
</ChatInvite.Root>
</View>
</View>
@@ -92,3 +91,22 @@ let MessageItemInviteEmbed = ({
}
MessageItemInviteEmbed = memo(MessageItemInviteEmbed)
export {MessageItemInviteEmbed}
function MessageItemInviteEmbedBody() {
const {status} = ChatInvite.useChatInvite()
if (status === 'loading') {
return <ChatInvite.Loading style={a.py_lg} />
}
if (status !== 'available') {
return <ChatInvite.Unavailable style={a.py_sm} />
}
return (
<>
<ChatInvite.Card size="small" />
<ChatInvite.JoinButton />
</>
)
}