File size: 332 Bytes
4e7644b
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
export function getSessionIdFromPath(pathname: string): string | undefined {
  const match = pathname.match(/^\/chat\/(.+)$/);
  return match?.[1];
}

export const CHAT_BASE_PATH = "/chat";

export function buildChatPath(sessionId?: string | null): string {
  return sessionId ? `${CHAT_BASE_PATH}/${sessionId}` : CHAT_BASE_PATH;
}