feat(dashboard): route conversations and media
This commit is contained in:
1 parent
768470204b
commit
20fa83f245
2 files changed
+27
-2
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { ConversationsPage } from './conversations-page.js';
|
||||
|
||||
export function ConversationRoute() {
|
||||
const navigate = useNavigate();
|
||||
const { conversationId } = useParams<{ conversationId: string }>();
|
||||
|
||||
function selectConversation(nextConversationId: string | null) {
|
||||
void navigate(
|
||||
nextConversationId
|
||||
? `/conversations/${encodeURIComponent(nextConversationId)}`
|
||||
: '/conversations',
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ConversationsPage
|
||||
selectedConversationId={conversationId ?? null}
|
||||
onSelectedConversationChange={selectConversation}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user