@@ -9,7 +9,6 @@ import { ScrollArea } from "@/components/ui/scroll-area";
99import { Separator } from "@/components/ui/separator" ;
1010import { Tooltip , TooltipContent , TooltipTrigger } from "@/components/ui/tooltip" ;
1111import { deleteChat , updateChatName } from "@/features/chat/actions" ;
12- import { useDomain } from "@/hooks/useDomain" ;
1312import { cn , isServiceError } from "@/lib/utils" ;
1413import { CirclePlusIcon , EllipsisIcon , PencilIcon , TrashIcon } from "lucide-react" ;
1514import { useRouter } from "next/navigation" ;
@@ -23,6 +22,7 @@ import { useChatId } from "../useChatId";
2322import { RenameChatDialog } from "./renameChatDialog" ;
2423import { DeleteChatDialog } from "./deleteChatDialog" ;
2524import Link from "next/link" ;
25+ import { SINGLE_TENANT_ORG_DOMAIN } from "@/lib/constants" ;
2626
2727interface ChatSidePanelProps {
2828 order : number ;
@@ -41,7 +41,6 @@ export const ChatSidePanel = ({
4141 isAuthenticated,
4242 isCollapsedInitially,
4343} : ChatSidePanelProps ) => {
44- const domain = useDomain ( ) ;
4544 const [ isCollapsed , setIsCollapsed ] = useState ( isCollapsedInitially ) ;
4645 const sidePanelRef = useRef < ImperativePanelHandle > ( null ) ;
4746 const router = useRouter ( ) ;
@@ -72,7 +71,7 @@ export const ChatSidePanel = ({
7271 const response = await updateChatName ( {
7372 chatId,
7473 name : name ,
75- } , domain ) ;
74+ } ) ;
7675
7776 if ( isServiceError ( response ) ) {
7877 toast ( {
@@ -84,14 +83,14 @@ export const ChatSidePanel = ({
8483 } ) ;
8584 router . refresh ( ) ;
8685 }
87- } , [ router , toast , domain ] ) ;
86+ } , [ router , toast ] ) ;
8887
8988 const onDeleteChat = useCallback ( async ( chatIdToDelete : string ) => {
9089 if ( ! chatIdToDelete ) {
9190 return ;
9291 }
9392
94- const response = await deleteChat ( { chatId : chatIdToDelete } , domain ) ;
93+ const response = await deleteChat ( { chatId : chatIdToDelete } ) ;
9594
9695 if ( isServiceError ( response ) ) {
9796 toast ( {
@@ -104,12 +103,12 @@ export const ChatSidePanel = ({
104103
105104 // If we just deleted the current chat, navigate to new chat
106105 if ( chatIdToDelete === chatId ) {
107- router . push ( `/${ domain } /chat` ) ;
106+ router . push ( `/${ SINGLE_TENANT_ORG_DOMAIN } /chat` ) ;
108107 }
109108
110109 router . refresh ( ) ;
111110 }
112- } , [ chatId , router , toast , domain ] ) ;
111+ } , [ chatId , router , toast ] ) ;
113112
114113 return (
115114 < >
@@ -131,7 +130,7 @@ export const ChatSidePanel = ({
131130 size = "sm"
132131 className = "w-full"
133132 onClick = { ( ) => {
134- router . push ( `/${ domain } /chat` ) ;
133+ router . push ( `/${ SINGLE_TENANT_ORG_DOMAIN } /chat` ) ;
135134 } }
136135 >
137136 < CirclePlusIcon className = "w-4 h-4 mr-1" />
@@ -145,7 +144,7 @@ export const ChatSidePanel = ({
145144 < div className = "flex flex-col" >
146145 < p className = "text-sm text-muted-foreground mb-4" >
147146 < Link
148- href = { `/login?callbackUrl=${ encodeURIComponent ( `/${ domain } /chat` ) } ` }
147+ href = { `/login?callbackUrl=${ encodeURIComponent ( `/${ SINGLE_TENANT_ORG_DOMAIN } /chat` ) } ` }
149148 className = "text-sm text-link hover:underline cursor-pointer"
150149 >
151150 Sign in
@@ -163,7 +162,7 @@ export const ChatSidePanel = ({
163162 chat . id === chatId && "bg-muted"
164163 ) }
165164 onClick = { ( ) => {
166- router . push ( `/${ domain } /chat/${ chat . id } ` ) ;
165+ router . push ( `/${ SINGLE_TENANT_ORG_DOMAIN } /chat/${ chat . id } ` ) ;
167166 } }
168167 >
169168 < span className = "text-sm truncate" > { chat . name ?? 'Untitled chat' } </ span >
0 commit comments