55
66// cSpell:ignore blankcolumn
77
8- import { Badge , Button , Col , Popconfirm , Row , Space , Tooltip } from "antd" ;
8+ import { Badge , Button , Col , Row , Space , Tooltip } from "antd" ;
99import { List , Map } from "immutable" ;
1010import { CSSProperties , useEffect , useLayoutEffect } from "react" ;
1111import { useIntl } from "react-intl" ;
12-
1312import { Avatar } from "@cocalc/frontend/account/avatar/avatar" ;
1413import {
1514 CSS ,
@@ -49,8 +48,6 @@ import {
4948 sender_is_viewer ,
5049} from "./utils" ;
5150
52- const DELETE_BUTTON = false ;
53-
5451const BLANK_COLUMN = ( xs ) => < Col key = { "blankcolumn" } xs = { xs } > </ Col > ;
5552
5653const MARKDOWN_STYLE = undefined ;
@@ -392,8 +389,6 @@ export default function Message({
392389 if ( isEditing ) {
393390 return null ;
394391 }
395- const showDeleteButton =
396- DELETE_BUTTON && newest_content ( message ) . trim ( ) . length > 0 ;
397392 const showEditingStatus =
398393 ( message . get ( "history" ) ?. size ?? 0 ) > 1 ||
399394 ( message . get ( "editing" ) ?. size ?? 0 ) > 0 ;
@@ -404,11 +399,7 @@ export default function Message({
404399 // vertical space, so only do it if there is a good reason to.
405400 // Getting rid of this might be nice.
406401 const show =
407- showEditButton ||
408- showDeleteButton ||
409- showEditingStatus ||
410- showHistory ||
411- showLLMFeedback ;
402+ showEditButton || showEditingStatus || showHistory || showLLMFeedback ;
412403 if ( ! show ) {
413404 // important to explicitly check this before rendering below, since otherwise we get a big BLANK space.
414405 return null ;
@@ -441,32 +432,6 @@ export default function Message({
441432 </ Button >
442433 </ Tip >
443434 ) : undefined }
444- { showDeleteButton && (
445- < Tip
446- title = "Delete this message. You can delete any past message by anybody. The deleted message can be view in history."
447- placement = "left"
448- >
449- < Popconfirm
450- title = "Delete this message"
451- description = "Are you sure you want to delete this message?"
452- onConfirm = { ( ) => {
453- actions ?. setEditing ( message , true ) ;
454- setTimeout ( ( ) => actions ?. sendEdit ( message , "" ) , 1 ) ;
455- } }
456- >
457- < Button
458- disabled = { replying }
459- style = { {
460- color : is_viewers_message ? "white" : "#555" ,
461- } }
462- type = "text"
463- size = "small"
464- >
465- < Icon name = "trash" /> Delete
466- </ Button >
467- </ Popconfirm >
468- </ Tip >
469- ) }
470435 { showEditingStatus && render_editing_status ( isEditing ) }
471436 { showHistory && (
472437 < Button
0 commit comments