import { useCallback, memo } from 'react' import { Button, Modal, ModalClose } from '@janhq/joi' import { Paintbrush } from 'lucide-react' import useDeleteThread from '@/hooks/useDeleteThread' type Props = { threadId: string closeContextMenu?: () => void } const ModalCleanThread = ({ threadId, closeContextMenu }: Props) => { const { cleanThread } = useDeleteThread() const onCleanThreadClick = useCallback( (e: React.MouseEvent) => { e.stopPropagation() cleanThread(threadId) }, [cleanThread, threadId] ) return ( { if (open && closeContextMenu) { closeContextMenu() } }} trigger={
e.stopPropagation()} > Clean thread
} content={

Are you sure you want to clean this thread?

e.stopPropagation()}>
} /> ) } export default memo(ModalCleanThread)