chore: move close icon last, set focus ref

This commit is contained in:
Galen 2025-10-07 15:53:12 -05:00
parent 12249d3211
commit e01856dc06
No known key found for this signature in database
1 changed files with 15 additions and 12 deletions

View File

@ -82,20 +82,9 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, isPinned, onCl
</div>
{(canEdit || canDelete || isPinned) && (
<div className={styles.controls}>
{isPinned && (
<IconButton
name={'times'}
size={'sm'}
onClick={(e) => {
// Don't trigger onClick
e.stopPropagation();
onClose();
}}
tooltip={t('timeseries.annotation-tooltip2.tooltip-close', 'Close')}
/>
)}
{canEdit && (
<IconButton
ref={focusRef}
name={'pen'}
size={'sm'}
onClick={onEdit}
@ -104,12 +93,26 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, isPinned, onCl
)}
{canDelete && (
<IconButton
ref={canEdit ? null : focusRef}
name={'trash-alt'}
size={'sm'}
onClick={() => onAnnotationDelete(annoId)}
tooltip={t('timeseries.annotation-tooltip2.tooltip-delete', 'Delete')}
/>
)}
{isPinned && (
<IconButton
ref={canEdit || canDelete ? null : focusRef}
name={'times'}
size={'sm'}
onClick={(e) => {
// Don't trigger onClick
e.stopPropagation();
onClose();
}}
tooltip={t('timeseries.annotation-tooltip2.tooltip-close', 'Close')}
/>
)}
</div>
)}
</Stack>