All files / src/components/chat/task-header/buttons OpenDiskConversationHistoryButton.tsx

0% Statements 0/27
0% Branches 0/1
0% Functions 0/1
0% Lines 0/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37                                                                         
import { Button, cn } from "@heroui/react"
import { StringRequest } from "@shared/proto/cline/common"
import { ArrowDownToLineIcon } from "lucide-react"
import HeroTooltip from "@/components/common/HeroTooltip"
import { FileServiceClient } from "@/services/grpc-client"
 
const OpenDiskConversationHistoryButton: React.FC<{
	taskId?: string
	className?: string
}> = ({ taskId, className }) => {
	const handleOpenDiskConversationHistory = () => {
		if (!taskId) {
			return
		}
 
		FileServiceClient.openDiskConversationHistory(StringRequest.create({ value: taskId })).catch((err) => {
			console.error(err)
		})
	}
 
	return (
		<HeroTooltip content="Open Conversation History File" placement="right">
			<Button
				aria-label="Open Disk Conversation History"
				className={cn("flex items-center border-0 text-sm font-bold bg-transparent hover:opacity-100", className)}
				isIconOnly={true}
				onPress={() => handleOpenDiskConversationHistory()}
				radius="sm"
				size="sm">
				<ArrowDownToLineIcon size="14" />
			</Button>
		</HeroTooltip>
	)
}
 
export default OpenDiskConversationHistoryButton