feat: Add functionality to view, insert, and replace code in ChatPanel

This commit is contained in:
Rankin Zheng 2023-05-10 20:49:06 +08:00
parent dd35eff4b4
commit a254f02824

View File

@ -340,18 +340,33 @@ const chatPanel = () => {
</Tooltip>
)}
</CopyButton>
<Tooltip label='View-diff' withArrow position="left" color="gray">
<ActionIcon>
<Tooltip label='View Diff' withArrow position="left" color="gray">
<ActionIcon onClick={() => {
messageUtil.sendMessage({
command: 'show_diff',
content: value
});
}}>
<IconFileDiff size="1.125rem" />
</ActionIcon>
</Tooltip>
<Tooltip label='Insert Code' withArrow position="left" color="gray">
<ActionIcon>
<ActionIcon onClick={() => {
messageUtil.sendMessage({
command: 'code_apply',
content: value
});
}}>
<IconColumnInsertRight size="1.125rem" />
</ActionIcon>
</Tooltip>
<Tooltip label='Replace' withArrow position="left" color="gray">
<ActionIcon>
<ActionIcon onClick={() => {
messageUtil.sendMessage({
command: 'code_file_apply',
content: value
});
}}>
<IconReplace size="1.125rem" />
</ActionIcon>
</Tooltip>