11'use client' ;
22
33import { isToday , isYesterday , subMonths , subWeeks } from 'date-fns' ;
4+ import type { User } from 'next-auth' ;
45import Link from 'next/link' ;
56import { useParams , usePathname , useRouter } from 'next/navigation' ;
6- import type { User } from 'next-auth' ;
77import { memo , useEffect , useState } from 'react' ;
88import { toast } from 'sonner' ;
99import useSWR from 'swr' ;
1010
1111import {
12- CheckCircleFillIcon ,
13- GlobeIcon ,
14- LockIcon ,
15- MoreHorizontalIcon ,
16- ShareIcon ,
1712 TrashIcon ,
1813} from '@/components/icons' ;
1914import {
@@ -30,25 +25,18 @@ import {
3025 DropdownMenu ,
3126 DropdownMenuContent ,
3227 DropdownMenuItem ,
33- DropdownMenuPortal ,
34- DropdownMenuSeparator ,
35- DropdownMenuSub ,
36- DropdownMenuSubContent ,
37- DropdownMenuSubTrigger ,
38- DropdownMenuTrigger ,
3928} from '@/components/ui/dropdown-menu' ;
4029import {
4130 SidebarGroup ,
4231 SidebarGroupContent ,
4332 SidebarMenu ,
44- SidebarMenuAction ,
4533 SidebarMenuButton ,
4634 SidebarMenuItem ,
4735 useSidebar ,
4836} from '@/components/ui/sidebar' ;
37+ import { useChatVisibility } from '@/hooks/use-chat-visibility' ;
4938import type { Chat } from '@/lib/db/schema' ;
5039import { fetcher } from '@/lib/utils' ;
51- import { useChatVisibility } from '@/hooks/use-chat-visibility' ;
5240
5341type GroupedChats = {
5442 today : Chat [ ] ;
@@ -83,54 +71,22 @@ const PureChatItem = ({
8371 </ SidebarMenuButton >
8472
8573 < DropdownMenu modal = { true } >
86- < DropdownMenuTrigger asChild >
74+ { /*
75+ TODO: Re-enable when conversation deletion is implemented
76+
77+ https://github.com/pattern-tech/pattern-app/issues/33
78+ */ }
79+ { /* <DropdownMenuTrigger asChild>
8780 <SidebarMenuAction
8881 className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground mr-0.5"
8982 showOnHover={!isActive}
9083 >
9184 <MoreHorizontalIcon />
9285 <span className="sr-only">More</span>
9386 </SidebarMenuAction>
94- </ DropdownMenuTrigger >
87+ </DropdownMenuTrigger> */ }
9588
9689 < DropdownMenuContent side = "bottom" align = "end" >
97- < DropdownMenuSub >
98- < DropdownMenuSubTrigger className = "cursor-pointer" >
99- < ShareIcon />
100- < span > Share</ span >
101- </ DropdownMenuSubTrigger >
102- < DropdownMenuPortal >
103- < DropdownMenuSubContent >
104- < DropdownMenuItem
105- className = "cursor-pointer flex-row justify-between"
106- onClick = { ( ) => {
107- setVisibilityType ( 'private' ) ;
108- } }
109- >
110- < div className = "flex flex-row gap-2 items-center" >
111- < LockIcon size = { 12 } />
112- < span > Private</ span >
113- </ div >
114- { visibilityType === 'private' ? (
115- < CheckCircleFillIcon />
116- ) : null }
117- </ DropdownMenuItem >
118- < DropdownMenuItem
119- className = "cursor-pointer flex-row justify-between"
120- onClick = { ( ) => {
121- setVisibilityType ( 'public' ) ;
122- } }
123- >
124- < div className = "flex flex-row gap-2 items-center" >
125- < GlobeIcon />
126- < span > Public</ span >
127- </ div >
128- { visibilityType === 'public' ? < CheckCircleFillIcon /> : null }
129- </ DropdownMenuItem >
130- </ DropdownMenuSubContent >
131- </ DropdownMenuPortal >
132- </ DropdownMenuSub >
133-
13490 < DropdownMenuItem
13591 className = "cursor-pointer text-destructive focus:bg-destructive/15 focus:text-destructive dark:text-red-500"
13692 onSelect = { ( ) => onDelete ( chat . id ) }
0 commit comments