fix: added dialog confimation clean thread
This commit is contained in:
parent
c723fb6866
commit
c95c765812
@ -87,7 +87,7 @@ export default function ThreadList() {
|
|||||||
<div
|
<div
|
||||||
key={i}
|
key={i}
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
`group/message relative mb-1 flex cursor-pointer flex-col transition-all hover:rounded-lg hover:bg-gray-100 hover:dark:bg-secondary/50`
|
`group/message relative mb-1 flex cursor-pointer flex-col transition-all hover:rounded-lg hover:bg-gray-100 hover:dark:bg-secondary/50`
|
||||||
)}
|
)}
|
||||||
onClick={() => onThreadClick(thread)}
|
onClick={() => onThreadClick(thread)}
|
||||||
>
|
>
|
||||||
@ -110,15 +110,41 @@ export default function ThreadList() {
|
|||||||
>
|
>
|
||||||
<MoreVerticalIcon />
|
<MoreVerticalIcon />
|
||||||
<div className="invisible absolute right-0 z-20 w-40 overflow-hidden rounded-lg border border-border bg-background shadow-lg group-hover/icon:visible">
|
<div className="invisible absolute right-0 z-20 w-40 overflow-hidden rounded-lg border border-border bg-background shadow-lg group-hover/icon:visible">
|
||||||
<div
|
<Modal>
|
||||||
className="flex cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-secondary"
|
<ModalTrigger asChild>
|
||||||
onClick={() => cleanThread(thread.id)}
|
<div className="flex cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-secondary">
|
||||||
>
|
<Paintbrush
|
||||||
<Paintbrush size={16} className="text-muted-foreground" />
|
size={16}
|
||||||
<span className="text-bold text-black dark:text-muted-foreground">
|
className="text-muted-foreground"
|
||||||
Clean thread
|
/>
|
||||||
</span>
|
<span className="text-bold text-black dark:text-muted-foreground">
|
||||||
</div>
|
Clean thread
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</ModalTrigger>
|
||||||
|
<ModalContent>
|
||||||
|
<ModalHeader>
|
||||||
|
<ModalTitle>Clean Thread</ModalTitle>
|
||||||
|
</ModalHeader>
|
||||||
|
<p>Are you sure you want to clean this thread?</p>
|
||||||
|
<ModalFooter>
|
||||||
|
<div className="flex gap-x-2">
|
||||||
|
<ModalClose asChild>
|
||||||
|
<Button themes="ghost">No</Button>
|
||||||
|
</ModalClose>
|
||||||
|
<ModalClose asChild>
|
||||||
|
<Button
|
||||||
|
themes="danger"
|
||||||
|
onClick={() => cleanThread(thread.id)}
|
||||||
|
>
|
||||||
|
Yes
|
||||||
|
</Button>
|
||||||
|
</ModalClose>
|
||||||
|
</div>
|
||||||
|
</ModalFooter>
|
||||||
|
</ModalContent>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
<Modal>
|
<Modal>
|
||||||
<ModalTrigger asChild>
|
<ModalTrigger asChild>
|
||||||
<div className="flex cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-secondary">
|
<div className="flex cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-secondary">
|
||||||
@ -155,9 +181,6 @@ export default function ThreadList() {
|
|||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* {messages.length > 0 && (
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{activeThreadId === thread.id && (
|
{activeThreadId === thread.id && (
|
||||||
<m.div
|
<m.div
|
||||||
className="absolute inset-0 left-0 h-full w-full rounded-lg bg-gray-100 p-4 dark:bg-secondary/50"
|
className="absolute inset-0 left-0 h-full w-full rounded-lg bg-gray-100 p-4 dark:bg-secondary/50"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user